Inbasasi opened a new issue, #21009: URL: https://github.com/apache/pulsar/issues/21009
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar. ### Version Apache Pulsar Version - 2.11.1 ### Minimal reproduce step The consumer is as below, `pulsarClient.newConsumer(Schema.JSON(Schedule.class)).ackTimeout(600000, TimeUnit.MILLISECONDS) .consumerName("test-consumer").topic(pulsarProperties.getTopic()) .subscriptionName("test-subscription") .subscriptionType(SubscriptionType.Shared) .deadLetterPolicy(DeadLetterPolicy.builder().maxRedeliverCount(5) .deadLetterTopic(pulsarProperties.getTopic() + "-dlq").build()) .autoUpdatePartitions(true).receiverQueueSize(2000) .subscriptionInitialPosition(SubscriptionInitialPosition.Earliest) .messageListener(consumer).subscribe();` ### What did you expect to see? The consumer should consume a message only once & that is happening as expected most of the time. But occasionally, The consumer is consuming the same message twice which is causing consistency issues with the application logic. ### What did you see instead? The consumer is consuming the same message twice which is causing consistency issues with the application logic. I confirmed the same by logging the message ID in the consumed message. ` 2023-08-14 02:32:15.221 INFO [1a512eb2-2c23-4b91-bd2e-cc656df3a9c8] [] [pulsar-external-listener-12-1] [RecurringScheduledEventHandler.java:38] c.f.s.s.p.RecurringScheduledEventHandler - >> handling mesage ID 100260:12688:0 - pulsar-105-23 ` `2023-08-14 02:32:15.225 INFO [720cf56f-9b4c-49f7-8f91-81c0fa9bba35] [] [pulsar-external-listener-12-1] [RecurringScheduledEventHandler.java:38] c.f.s.s.p.RecurringScheduledEventHandler - >> handling mesage ID 100260:12688:0 - pulsar-105-23 ` Here, The same message ID `100260:12688:0` is consumed by the same consumer thread `pulsar-external-listener-12-1` within few ms by `1a512eb2-2c23-4b91-bd2e-cc656df3a9c8` & `720cf56f-9b4c-49f7-8f91-81c0fa9bba35` ### 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]
