Using below configuration aplication.yml, for a consumer application through Spring Cloud Stream 3.0.12.RELEASE and Spring Boot 2.5.6
spring:
main:
web-application-type: none
cloud:
stream:
bindings:
consumeSomething-in-0:
destination: some-topic-vhost2
group: some-events
binder: local_rabbit
consumer:
max-attempts: 1
auto-bind-dlq: true
dlq-ttl: 50000
republishToDlq: true
I am trying to manage error handling with republishToDlq
to route the messages which throw exception together with exception stack trace. In the document it is told that;
..." In addition, republishToDlq causes the binder to publish a failed message to the DLQ (instead of rejecting it). This feature lets additional information (such as the stack trace in the x-exception-stacktrace header) be added to the message in headers."
When I check the queue some-topic-vhost2.some-events.dlq
, I figure out that the message which throws exception routed to that queue. It is OK. But the exception stack trace is not added as a header. And also, the applicaiton send as a warning below,
o.s.c.s.b.r.RabbitMessageChannelBinder : 'republishToDlq' is true, but the 'DLX' dead letter exchange is not present; disabling 'republishToDlq'
What is wrong with this config. What should I do to enable republishToDlq