-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Default destination resolver in DeadLetterPublishingRecoverer issue when DLT partitions are less than original topic partitions #1700
Comments
garyrussell
added
status: invalid
type: documentation
and removed
status: invalid
labels
Feb 8, 2021
As I said on the PR; we can't just change the default like that; we will make the documentation more visible, |
On reflection, I think we could inspect the DLT (if we have permissions) and log a WARN if the resolved partition doesn't exist. That will satisfy your request, and prevent a breaking behavior change. |
garyrussell
added a commit
that referenced
this issue
Feb 10, 2021
garyrussell
added a commit
that referenced
this issue
Feb 10, 2021
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Feb 10, 2021
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Feb 10, 2021
artembilan
pushed a commit
that referenced
this issue
Feb 10, 2021
garyrussell
added a commit
that referenced
this issue
Feb 11, 2021
This was referenced Mar 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The default destination resolver in the DeadLetterPublishingRecoverer routes the records to a topic partition with the same name as the incoming consumer record + the suffix ".DLT", and the same partition as the incoming consumer record.
DEFAULT_DESTINATION_RESOLVER = (cr, e) -> new TopicPartition(cr.topic() + ".DLT", cr.partition());
This is a problem as this logic assumes that the number of partitions for the DLT is the same as the number of partitions of the original topic, which is not necessarily true.
In case the partitions for the DLT are less, this result in exceptions, as the destination partitions do not exist. Likewise in the (unlikely) case the DTL has more partitions than the original topic, some of them will be idle.
The solution I have successfully used is to set the destination partition to -1, which will delegate the choice of the destination partition within the DLT to Kafka.
DEFAULT_DESTINATION_RESOLVER = (cr, e) -> new TopicPartition(cr.topic() + ".DLT", -1);
Will submit a PR with a test to prove the case. I think this should be the default mechanism.
The text was updated successfully, but these errors were encountered: