Class SenderTest
java.lang.Object
org.apache.kafka.clients.producer.internals.SenderTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetup()voidtearDown()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidVerifies that InitProducerId of idempotent producer succeeds even if metadata requests are pending with only one bootstrap node available and maxInFlight=1, where multiple polls are necessary to send requests.voidvoidvoidvoidvoidvoidVerifies that InitProducerId of transactional producer succeeds even if metadata requests are pending with only one bootstrap node available and maxInFlight=1, where multiple polls are necessary to send requests.voidvoidTests that topics are added to the metadata list when messages are available to send and expired if not used during a metadata refresh interval.voidvoidvoidTests the code path where the target node to send FindCoordinator or InitProducerId is not ready.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidtestTransactionShouldTransitionToAbortableForSenderAPI(org.apache.kafka.common.protocol.Errors error) voidvoidvoidvoidvoidvoidvoidTest the scenario that ProduceResponse returns NOT_LEADER_OR_FOLLOWER, indicating change in leadership, along with new leader info(defined in KIP-951).voidTest the scenario that ProduceResponse returns NOT_LEADER_OR_FOLLOWER, indicating change in leadership, but it does not contain new leader info(defined in KIP-951).
-
Constructor Details
-
SenderTest
public SenderTest()
-
-
Method Details
-
setup
@BeforeEach public void setup() -
tearDown
@AfterEach public void tearDown() -
testSimple
-
testQuotaMetrics
@Test public void testQuotaMetrics() -
testSenderMetricsTemplates
-
testRetries
-
testSendInOrder
-
testAppendInExpiryCallback
- Throws:
InterruptedException
-
testMetadataTopicExpiry
-
senderThreadShouldNotGetStuckWhenThrottledAndAddingPartitionsToTxn
@Test public void senderThreadShouldNotGetStuckWhenThrottledAndAddingPartitionsToTxn() -
testNodeLatencyStats
-
testInitProducerIdRequest
@Test public void testInitProducerIdRequest() -
testInitProducerIdWithMaxInFlightOne
@Test public void testInitProducerIdWithMaxInFlightOne()Verifies that InitProducerId of transactional producer succeeds even if metadata requests are pending with only one bootstrap node available and maxInFlight=1, where multiple polls are necessary to send requests. -
testIdempotentInitProducerIdWithMaxInFlightOne
@Test public void testIdempotentInitProducerIdWithMaxInFlightOne()Verifies that InitProducerId of idempotent producer succeeds even if metadata requests are pending with only one bootstrap node available and maxInFlight=1, where multiple polls are necessary to send requests. -
testNodeNotReady
@Test public void testNodeNotReady()Tests the code path where the target node to send FindCoordinator or InitProducerId is not ready. -
testClusterAuthorizationExceptionInInitProducerIdRequest
-
testCanRetryWithoutIdempotence
-
testIdempotenceWithMultipleInflights
-
testIdempotenceWithMultipleInflightsRetriedInOrder
-
testIdempotenceWithMultipleInflightsWhereFirstFailsFatallyAndSequenceOfFutureBatchesIsAdjusted
-
testEpochBumpOnOutOfOrderSequenceForNextBatch
-
testEpochBumpOnOutOfOrderSequenceForNextBatchWhenThereIsNoBatchInFlight
-
testEpochBumpOnOutOfOrderSequenceForNextBatchWhenBatchInFlightFails
-
testCorrectHandlingOfOutOfOrderResponses
-
testCorrectHandlingOfOutOfOrderResponsesWhenSecondSucceeds
-
testExpiryOfUnsentBatchesShouldNotCauseUnresolvedSequences
-
testExpiryOfFirstBatchShouldNotCauseUnresolvedSequencesIfFutureBatchesSucceed
-
testExpiryOfFirstBatchShouldCauseEpochBumpIfFutureBatchesFail
-
testUnresolvedSequencesAreNotFatal
-
testExpiryOfAllSentBatchesShouldCauseUnresolvedSequences
-
testResetOfProducerStateShouldAllowQueuedBatchesToDrain
-
testCloseWithProducerIdReset
-
testForceCloseWithProducerIdReset
-
testBatchesDrainedWithOldProducerIdShouldSucceedOnSubsequentRetry
-
testCorrectHandlingOfDuplicateSequenceError
-
testTransactionalUnknownProducerHandlingWhenRetentionLimitReached
-
testIdempotentUnknownProducerHandlingWhenRetentionLimitReached
-
testUnknownProducerErrorShouldBeRetriedWhenLogStartOffsetIsUnknown
-
testUnknownProducerErrorShouldBeRetriedForFutureBatchesWhenFirstFails
-
testShouldRaiseOutOfOrderSequenceExceptionToUserIfLogWasNotTruncated
-
testClusterAuthorizationExceptionInProduceRequest
-
testCancelInFlightRequestAfterFatalError
-
testUnsupportedForMessageFormatInProduceRequest
-
testUnsupportedVersionInProduceRequest
-
testSequenceNumberIncrement
- Throws:
InterruptedException
-
testRetryWhenProducerIdChanges
- Throws:
InterruptedException
-
testBumpEpochWhenOutOfOrderSequenceReceived
- Throws:
InterruptedException
-
testIdempotentSplitBatchAndSend
-
testTransactionalSplitBatchAndSend
-
testNoDoubleDeallocation
-
testInflightBatchesExpireOnDeliveryTimeout
- Throws:
InterruptedException
-
testRecordErrorPropagatedToApplication
- Throws:
InterruptedException
-
testWhenFirstBatchExpireNoSendSecondBatchIfGuaranteeOrder
@Test public void testWhenFirstBatchExpireNoSendSecondBatchIfGuaranteeOrder() throws InterruptedException- Throws:
InterruptedException
-
testExpiredBatchDoesNotRetry
-
testExpiredBatchDoesNotSplitOnMessageTooLargeError
-
testResetNextBatchExpiry
-
testExpiredBatchesInMultiplePartitions
-
testTransactionalRequestsSentOnShutdown
@Test public void testTransactionalRequestsSentOnShutdown() -
testRecordsFlushedImmediatelyOnTransactionCompletion
-
testAwaitPendingRecordsBeforeCommittingTransaction
-
testIncompleteTransactionAbortOnShutdown
@Test public void testIncompleteTransactionAbortOnShutdown() -
testForceShutdownWithIncompleteTransaction
@Timeout(10L) @Test public void testForceShutdownWithIncompleteTransaction() -
testTransactionAbortedExceptionOnAbortWithoutError
- Throws:
InterruptedException
-
testDoNotPollWhenNoRequestSent
@Test public void testDoNotPollWhenNoRequestSent() -
testTooLargeBatchesAreSafelyRemoved
- Throws:
InterruptedException
-
testDefaultErrorMessage
-
testCustomErrorMessage
-
testTransactionShouldTransitionToAbortableForSenderAPI
@ParameterizedTest @EnumSource(value=org.apache.kafka.common.protocol.Errors.class, names={"COORDINATOR_LOAD_IN_PROGRESS","INVALID_TXN_STATE"}) public void testTransactionShouldTransitionToAbortableForSenderAPI(org.apache.kafka.common.protocol.Errors error) throws InterruptedException - Throws:
InterruptedException
-
testSenderShouldRetryWithBackoffOnRetriableError
- Throws:
InterruptedException
-
testReceiveFailedBatchTwiceWithTransactions
-
testInvalidTxnStateIsAnAbortableError
-
testTransactionAbortableExceptionIsAnAbortableError
-
testAbortableErrorIsConvertedToFatalErrorDuringAbort
-
testProducerBatchRetriesWhenPartitionLeaderChanges
-
testSenderShouldCloseWhenTransactionManagerInErrorState
@Timeout(5L) @Test public void testSenderShouldCloseWhenTransactionManagerInErrorState() -
testWhenProduceResponseReturnsWithALeaderShipChangeErrorButNoNewLeaderInformation
@Test public void testWhenProduceResponseReturnsWithALeaderShipChangeErrorButNoNewLeaderInformation() throws InterruptedExceptionTest the scenario that ProduceResponse returns NOT_LEADER_OR_FOLLOWER, indicating change in leadership, but it does not contain new leader info(defined in KIP-951).- Throws:
InterruptedException
-
testWhenProduceResponseReturnsWithALeaderShipChangeErrorAndNewLeaderInformation
@Test public void testWhenProduceResponseReturnsWithALeaderShipChangeErrorAndNewLeaderInformation() throws InterruptedExceptionTest the scenario that ProduceResponse returns NOT_LEADER_OR_FOLLOWER, indicating change in leadership, along with new leader info(defined in KIP-951).- Throws:
InterruptedException
-
testNoBufferReuseWhenBatchExpires
-