@Override
    protected int poll() throws Exception {
        // must reset for each poll
        shutdownRunningTask = null;
        pendingExchanges = 0;

        List<software.amazon.awssdk.services.sqs.model.Message> messages = pollingTask.call();
        // okay we have some response from aws so lets mark the consumer as ready
        forceConsumerAsReady();

        Queue<Exchange> exchanges = createExchanges(messages);
        return processBatch(CastUtils.cast(exchanges));
    }
@Test
    void shouldIgnoreErrorsOnAtLeastOneSuccessfulReceiveRequest() throws Exception {
        // given
        sqsClientMock.addMessage(message("A"));
        sqsClientMock.addMessage(message("B"));
        sqsClientMock.addMessage(message("C"));
        sqsClientMock.setReceiveRequestHandler(request -> {
            if (request.maxNumberOfMessages() != null && request.maxNumberOfMessages().intValue() == 10) {
                throw SqsException.builder().build();
            }
        });

        try (var tested = createConsumer(25)) {

            // when
            var polledMessagesCount = tested.poll();

            // then
            assertThat(polledMessagesCount).isEqualTo(3);
            assertThat(receiveMessageBodies()).containsExactly("A", "B", "C");
            assertThat(sqsClientMock.getReceiveRequests()).containsExactlyInAnyOrder(
                    expectedReceiveRequest(10),
                    expectedReceiveRequest(10),
                    expectedReceiveRequest(5));
            assertThat(sqsClientMock.getQueues()).isEmpty();
        }
    }