KamenRiderKuuga opened a new issue, #20667:
URL: https://github.com/apache/pulsar/issues/20667

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   Due to consumers keep subscribing to their own retries and dead letter 
messages, Topic is infinitely appended (`allowAutoTopicCreation = true`)
   
   ### Minimal reproduce step
   
   The code used to reproduce:
   
   ```java
   public static void main(String[] args) throws IOException {
       AuthenticationBasic auth = new AuthenticationBasic();
       auth.configure("{\"userId\":\"superuser\",\"password\":\"admin\"}");
       String serviceUrl = "pulsar://127.0.0.1:6650";
       String topicPattern = "persistent://public/default/ubw.*";
       PulsarClient pulsarClient = 
PulsarClient.builder().serviceUrl(serviceUrl).authentication(auth).build();
       var consumerBuilder = 
pulsarClient.newConsumer(Schema.BYTES).topicsPattern(topicPattern).subscriptionName("ubw-test")
               .subscriptionType(SubscriptionType.Shared)
               .enableRetry(true)
               .deadLetterPolicy(DeadLetterPolicy.builder()
                       .maxRedeliverCount(3)
                       .build())
               
.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
               .messageListener((consumer, msg) -> {
                   
System.out.println("=======================================");
                   System.out.println("msg = " + new String(msg.getData()));
                   System.out.println("topic = " + msg.getTopicName());
                   System.out.println("key = " + msg.getKey());
                   System.out.println("properties = " + msg.getProperties());
                   try {
                       consumer.reconsumeLater(msg, 1, TimeUnit.SECONDS);
                   } catch (PulsarClientException e) {
                       throw new RuntimeException(e);
                   }
               }).patternAutoDiscoveryPeriod(1, TimeUnit.SECONDS);
       consumerBuilder.subscribe();
       System.in.read();
   }
   ```
   
   ### What did you expect to see?
   
   This is a bit strange, I think it should automatically ack when the dead 
letter message is consumed?
   
   This problem will eventually cause Pulsar to throw an exception:
   Got exception 
org.apache.pulsar.shade.io.netty.handler.codec.TooLongFrameException: Adjusted 
frame length exceeds 5253120: 5263796 - discarded
   
   ### What did you see instead?
   
   Topic is constantly appended, reaching a terrifying length
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to