-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dead-Letter Queues #189
Comments
I am writing rejected messages to "TopicName{{RejectedMessage}}" then acknowledging the message. It'd be nice to have the broker handle this atomically. An API like: reject(msgId); // sends message into dead letter box for subscription; acknowledged in process
reroute(msgId, specificTopic); // same but into a specific topic |
The primary concern I have with dead-letter queue is how to avoid that some misconfiguration can lead to send everything into that topic. In some cases the application can have a pretty good idea that a message is bad/corrupted and thus triggering the rerouting of the message, but if for example a new field is introduced and the consumer is not updated, it might start sending everything to DLQ. About doing the work in client vs server. I don't think there is a big functional difference. The 2 operations cannot be atomically executed anyway, we have to first publish and then skip the bad message. My preference would go to doing that in client lib, to avoid scalability concern in broker. Adding on what proposed by @agarman, what about configuring the DLQ on consumer config? consumerConf.setDeadLetterQueue("persistent://.....");
consumerConf.sendToDeadLetterQueueAfterRetries(10); Then in consumer code: while (true) {
Message msg = consumer.receive();
try {
// processMessage()
} catch (Exception e) {
consumer.reject(msg);
continue;
}
consumer.acknowledge(msg);
} The difficult part would be how to support transient vs persistent errors and rejections. |
PIP-22 is the proposal for implementing dead letter queue. |
@codelipenghui @jiazhai : you guys can probably use this issue as the main issue for dead letter topic implementation. |
#2400 is implementing dead letter topic. |
Closing as a dupe of #2400 |
### Motivation Fixes #189 When consumer got messages from pulsar, It's difficult to ensure every message can be consume success. Pulsar support message redelivery feature by set acknowledge timeout when create a new consumer. This is a good feature guarantee consumer will not lost messages. But however, some message will redelivery so many times possible, even to the extent that it can be never stop. So, It's necessary to support a feature to control it by pulsar. Users can use this feature and customize this feature to control the message redelivery behavior. The feature named Dead Letter Topic. ### Modifications Consumer can set maximum number of redeliveries by java client. Consumer can set the name of Dead Letter Topic by java client, It’s not necessary. Message exceeding the maximum number of redeliveries should send to Dead Letter Topic and acknowledged automatic. ### Result If consumer enable future of dead letter topic. When Message exceeding the maximum number of redeliveries, message will send to the Dead Letter Topic and acknowledged automatic.
Hey guys, are there any plans to add DLQ support in the Golang CGo based library? I see that it's supported in the pure Golang one which we are not using though due to your disclaimer saying that feature parity and stability has not been reached. |
Bump version to 0.3.1-SNAPSHOT
Pulsar should support dead-letter queues to prevent consumers being stuck when they cannot acknowledge a message.
Reference #180
The text was updated successfully, but these errors were encountered: