Skip to content

Commit 7891ac5

Browse files
authored
Disable batch send for dlq producer. (#403)
1 parent 68b4244 commit 7891ac5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/ConsumerImpl.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,7 @@ void ConsumerImpl::processPossibleToDLQ(const MessageId& messageId, ProcessDLQCa
17361736
ProducerConfiguration producerConfiguration;
17371737
producerConfiguration.setSchema(config_.getSchema());
17381738
producerConfiguration.setBlockIfQueueFull(false);
1739+
producerConfiguration.setBatchingEnabled(false);
17391740
producerConfiguration.impl_->initialSubscriptionName =
17401741
deadLetterPolicy_.getInitialSubscriptionName();
17411742
ClientImplPtr client = client_.lock();

tests/DeadLetterQueueTest.cc

+2
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ TEST_P(DeadLetterQueueTest, testSendDLQTriggerByRedeliverUnacknowledgedMessages)
270270
ASSERT_EQ(msg.getPartitionKey(), "p-key");
271271
ASSERT_EQ(msg.getOrderingKey(), "o-key");
272272
ASSERT_EQ(msg.getProperty("pk-1"), "pv-1");
273+
ASSERT_EQ(msg.getMessageId().batchSize(), 0);
274+
ASSERT_EQ(msg.getMessageId().batchIndex(), -1);
273275
ASSERT_TRUE(msg.getProperty(SYSTEM_PROPERTY_REAL_TOPIC).find(topic_));
274276
ASSERT_FALSE(msg.getProperty(PROPERTY_ORIGIN_MESSAGE_ID).empty());
275277
}

0 commit comments

Comments
 (0)