-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
type/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug
Description
Search before asking
- I searched in the issues and found nothing similar.
Version
Server Version:
2.10.2
3.0.0
Client Version:
Java 2.10.2
Java 3.0.0
Minimal reproduce step
- Create a topic: my_topic.
- Subscribe to 'my_topic' with regular expression 'my_.*', enable retry, and subscribe with the name 'my_sub'.
- When receiving messages, use 'consumer.reconsumeLaterAsync' to retry.
- Send some messages to 'my_topic'.
- View the generated RETRY topics.
public static void main(String[] args) throws IOException {
PulsarClient client = PulsarClient.builder().serviceUrl("pulsar://127.0.0.1:6650").build();
Consumer<String> consumer = client.newConsumer(Schema.STRING)
.subscriptionName("my_sub")
.subscriptionType(SubscriptionType.Shared)
.topicsPattern("persistent://public/default/my_.*")
.enableRetry(true)
.deadLetterPolicy(DeadLetterPolicy.builder()
.maxRedeliverCount(3)
.build())
.messageListener((c, msg) -> {
//trigger retry
System.out.println("receive msg:" + msg);
c.reconsumeLaterAsync(msg, 5, TimeUnit.SECONDS);
})
.subscribe();
System.out.println("subscribed..." + consumer.getConsumerName());
Producer<String> producer = client.newProducer(Schema.STRING).topic("persistent://public/default/my_topic").create();
MessageId msgId = producer.newMessage(Schema.STRING).value("test message").send();
System.out.println(msgId);
System.in.read();
}subscribe topic with pattern:my_.*
send
What did you expect to see?
There is only one topic named 'my_topic-my_sub-RETRY'
What did you see instead?
Every time I restart the subscription, a new RETRY queue is generated, for example:
First time: 'my_topic-my_sub-RETRY',
Second time: 'my_topic-my_sub-RETRY-my_sub-RETRY',
Third time: 'my_topic-my_sub-RETRY-my_sub-RETRY-my_sub-RETRY'.
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
Metadata
Metadata
Assignees
Labels
type/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug