Skip to content
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

Set Rabbitmq Metadata on DLQ messages after nack #2877

Open
BrianH85 opened this issue Dec 19, 2024 · 0 comments
Open

Set Rabbitmq Metadata on DLQ messages after nack #2877

BrianH85 opened this issue Dec 19, 2024 · 0 comments

Comments

@BrianH85
Copy link

Hello, I'm trying to set additional headers on messages when sending them to dlq after a message.nack(). Currently this does not seem to work. The code I tried uses:

OutgoingRabbitMQMetadata metadata = new OutgoingRabbitMQMetadata.Builder() .withHeaders(headers) .build();

to create the metadata. I then tried adding it to the message first:

message.addMetadata(metadata); message.nack(new RuntimeException("Fail to DLQ");

And after that didn't work tried adding the metadata inside the nack:

message.nack(new RuntimeException("Fail to DLQ"), Metadata.of(metadata));

Am I missing something here or is it not possible to add headers when sending to the DLQ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant