You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "thetumbled (via GitHub)" <gi...@apache.org> on 2025/03/12 07:25:20 UTC
[PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
thetumbled opened a new pull request, #24071:
URL: https://github.com/apache/pulsar/pull/24071
### Motivation
https://github.com/apache/pulsar/pull/24020 support configure the producer of retry/dead-letter topic, but it don't take effect.
### Modifications
Make sure the config is used.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1995124410
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1183,6 +1188,23 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
} while (totalInDeadLetter < sendMessages);
assertTrue(messageContent.isEmpty());
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ Producer<byte[]> retryProducer = consumerImpl.getRetryLetterProducer();
+ Producer<byte[]> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ // there are two type of consumers in MultiTopicsConsumerImpl when enableRetry is true
+ // 1. consumer subscribe to original topic
+ // 2. consumer subscribe to retry topic
+ if (consumerImpl.getTopic().endsWith(RetryMessageUtil.RETRY_GROUP_TOPIC_SUFFIX)) {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
+ assertTrue(((ProducerImpl<byte[]>) deadLetterProducer).isBatchMessagingEnabled());
+ } else {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
Review Comment:
sorry, makes sense now :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#issuecomment-2724147938
## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24071?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `66.66667%` with `2 lines` in your changes missing coverage. Please review.
> Project coverage is 74.16%. Comparing base [(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`4530b6b`)](https://app.codecov.io/gh/apache/pulsar/commit/4530b6b44a5478c0e99e9d8e63f6103b72319a36?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 962 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/24071?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...va/org/apache/pulsar/client/impl/ConsumerImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/24071?src=pr&el=tree&filepath=pulsar-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fclient%2Fimpl%2FConsumerImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVySW1wbC5qYXZh) | 66.66% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/pulsar/pull/24071?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/pulsar/pull/24071?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #24071 +/- ##
============================================
+ Coverage 73.57% 74.16% +0.58%
+ Complexity 32624 2379 -30245
============================================
Files 1877 1863 -14
Lines 139502 144297 +4795
Branches 15299 16459 +1160
============================================
+ Hits 102638 107015 +4377
+ Misses 28908 28828 -80
- Partials 7956 8454 +498
```
| [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24071/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [inttests](https://app.codecov.io/gh/apache/pulsar/pull/24071/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.94% <66.66%> (+2.35%)` | :arrow_up: |
| [systests](https://app.codecov.io/gh/apache/pulsar/pull/24071/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.20% <0.00%> (-1.12%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24071/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.65% <66.66%> (+0.80%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/24071?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [...va/org/apache/pulsar/client/impl/ProducerImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/24071?src=pr&el=tree&filepath=pulsar-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fclient%2Fimpl%2FProducerImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1Byb2R1Y2VySW1wbC5qYXZh) | `84.16% <ΓΈ> (+0.56%)` | :arrow_up: |
| [...va/org/apache/pulsar/client/impl/ConsumerImpl.java](https://app.codecov.io/gh/apache/pulsar/pull/24071?src=pr&el=tree&filepath=pulsar-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fclient%2Fimpl%2FConsumerImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL0NvbnN1bWVySW1wbC5qYXZh) | `79.16% <66.66%> (+1.58%)` | :arrow_up: |
... and [1062 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24071/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary>π New features to boost your workflow: </summary>
- β [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- π¦ [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1995003035
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1183,6 +1188,23 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
} while (totalInDeadLetter < sendMessages);
assertTrue(messageContent.isEmpty());
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ Producer<byte[]> retryProducer = consumerImpl.getRetryLetterProducer();
+ Producer<byte[]> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ // there are two type of consumers in MultiTopicsConsumerImpl when enableRetry is true
+ // 1. consumer subscribe to original topic
+ // 2. consumer subscribe to retry topic
+ if (consumerImpl.getTopic().endsWith(RetryMessageUtil.RETRY_GROUP_TOPIC_SUFFIX)) {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
+ assertTrue(((ProducerImpl<byte[]>) deadLetterProducer).isBatchMessagingEnabled());
+ } else {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
Review Comment:
otherwise assertions look fine
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1995001849
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1183,6 +1188,23 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
} while (totalInDeadLetter < sendMessages);
assertTrue(messageContent.isEmpty());
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ Producer<byte[]> retryProducer = consumerImpl.getRetryLetterProducer();
+ Producer<byte[]> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ // there are two type of consumers in MultiTopicsConsumerImpl when enableRetry is true
+ // 1. consumer subscribe to original topic
+ // 2. consumer subscribe to retry topic
+ if (consumerImpl.getTopic().endsWith(RetryMessageUtil.RETRY_GROUP_TOPIC_SUFFIX)) {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
+ assertTrue(((ProducerImpl<byte[]>) deadLetterProducer).isBatchMessagingEnabled());
+ } else {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
Review Comment:
typos?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "thetumbled (via GitHub)" <gi...@apache.org>.
thetumbled merged PR #24071:
URL: https://github.com/apache/pulsar/pull/24071
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1993217301
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1171,6 +1176,21 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
consumer.reconsumeLater(message, 1, TimeUnit.SECONDS);
} while (totalReceived < sendMessages * (maxRedeliveryCount + 1));
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ CompletableFuture<Producer<byte[]>> retryProducer = consumerImpl.getRetryLetterProducer();
+ CompletableFuture<Producer<byte[]>> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ if (retryProducer != null) {
Review Comment:
shouldn't it be asserted that retryProducer and deadLetterProducer aren't null?
btw. you could simplify the assertions by using AssertJ. One of the benefits is that it has ways to provide better error messages when things fail and the API is nice.
The complete check would be like this in AssertJ:
```java
import static org.assertj.core.api.Assertions.assertThat;
...
assertThat(((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers()).isNotEmpty()
.allSatisfy(consumerImpl -> {
assertThat(consumerImpl.getRetryLetterProducer()).isCompletedWithValueMatching(p ->
((ProducerImpl) p).isBatchMessagingEnabled()
);
assertThat(consumerImpl.getDeadLetterProducer()).isCompletedWithValueMatching(p ->
((ProducerImpl) p).isBatchMessagingEnabled()
);
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1993217301
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1171,6 +1176,21 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
consumer.reconsumeLater(message, 1, TimeUnit.SECONDS);
} while (totalReceived < sendMessages * (maxRedeliveryCount + 1));
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ CompletableFuture<Producer<byte[]>> retryProducer = consumerImpl.getRetryLetterProducer();
+ CompletableFuture<Producer<byte[]>> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ if (retryProducer != null) {
Review Comment:
shouldn't it be expended that retryProducer and deadLetterProducer isn't null?
btw. you could simplify the assertions by using AssertJ. One of the benefits is that it has ways to provide better error messages when things fail and the API is nice.
The complete check would be like this in AssertJ:
```java
import static org.assertj.core.api.Assertions.assertThat;
...
assertThat(((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers()).isNotEmpty()
.allSatisfy(consumerImpl -> {
assertThat(consumerImpl.getRetryLetterProducer()).isCompletedWithValueMatching(p ->
((ProducerImpl) p).isBatchMessagingEnabled()
);
assertThat(consumerImpl.getDeadLetterProducer()).isCompletedWithValueMatching(p ->
((ProducerImpl) p).isBatchMessagingEnabled()
);
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "thetumbled (via GitHub)" <gi...@apache.org>.
thetumbled commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1995059287
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1183,6 +1188,23 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
} while (totalInDeadLetter < sendMessages);
assertTrue(messageContent.isEmpty());
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ Producer<byte[]> retryProducer = consumerImpl.getRetryLetterProducer();
+ Producer<byte[]> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ // there are two type of consumers in MultiTopicsConsumerImpl when enableRetry is true
+ // 1. consumer subscribe to original topic
+ // 2. consumer subscribe to retry topic
+ if (consumerImpl.getTopic().endsWith(RetryMessageUtil.RETRY_GROUP_TOPIC_SUFFIX)) {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
+ assertTrue(((ProducerImpl<byte[]>) deadLetterProducer).isBatchMessagingEnabled());
+ } else {
+ assertTrue(((ProducerImpl<byte[]>) retryProducer).isBatchMessagingEnabled());
Review Comment:
what typos?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "thetumbled (via GitHub)" <gi...@apache.org>.
thetumbled commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1994932879
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1171,6 +1176,21 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
consumer.reconsumeLater(message, 1, TimeUnit.SECONDS);
} while (totalReceived < sendMessages * (maxRedeliveryCount + 1));
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ CompletableFuture<Producer<byte[]>> retryProducer = consumerImpl.getRetryLetterProducer();
+ CompletableFuture<Producer<byte[]>> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ if (retryProducer != null) {
Review Comment:
> shouldn't it be asserted that retryProducer and deadLetterProducer aren't null?
No, deadLetterProducer will be null when the consumer consumes from the orignal topic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1993217301
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1171,6 +1176,21 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
consumer.reconsumeLater(message, 1, TimeUnit.SECONDS);
} while (totalReceived < sendMessages * (maxRedeliveryCount + 1));
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ CompletableFuture<Producer<byte[]>> retryProducer = consumerImpl.getRetryLetterProducer();
+ CompletableFuture<Producer<byte[]>> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ if (retryProducer != null) {
Review Comment:
shouldn't it be expended that retryProducer and deadLetterProducer isn't null?
btw. you could simplify the assertions by using AssertJ. One of the benefits is that it has ways to provide better error messages when things fail and the API is nice.
The complete check would be like this in AssertJ:
```java
assertThat(((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers()).isNotEmpty()
.allSatisfy(consumerImpl -> {
assertThat(consumerImpl.getRetryLetterProducer()).isCompletedWithValueMatching(p ->
((ProducerImpl) p).isBatchMessagingEnabled()
);
assertThat(consumerImpl.getDeadLetterProducer()).isCompletedWithValueMatching(p ->
((ProducerImpl) p).isBatchMessagingEnabled()
);
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][client] PIP-409 retry/dead letter topic producer config don't take effect. [pulsar]
Posted by "thetumbled (via GitHub)" <gi...@apache.org>.
thetumbled commented on code in PR #24071:
URL: https://github.com/apache/pulsar/pull/24071#discussion_r1993427709
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java:
##########
@@ -1171,6 +1176,21 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
consumer.reconsumeLater(message, 1, TimeUnit.SECONDS);
} while (totalReceived < sendMessages * (maxRedeliveryCount + 1));
+ // check the retry topic producer enable batch
+ List<ConsumerImpl<byte[]>> consumers = ((MultiTopicsConsumerImpl<byte[]>) consumer).getConsumers();
+ for (ConsumerImpl<byte[]> consumerImpl : consumers) {
+ CompletableFuture<Producer<byte[]>> retryProducer = consumerImpl.getRetryLetterProducer();
+ CompletableFuture<Producer<byte[]>> deadLetterProducer = consumerImpl.getDeadLetterProducer();
+ if (retryProducer != null) {
Review Comment:
fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org