I am using spring-rabbit1.1 and RabbitMQ 3.3.1 ,
My spring configuration will create any queue with the help of RabbitTemplate on Rabbit MQ but if the queue has been configured with x-dead-letter-exchange and x-message-ttl , it just creates the queue with out the TTL and dead letter exchange.
For Eg : the below queue will create the queue but TTL and dead letter exhange is not getting created .
<rabbit:queue name="hello.queue.dead">
<rabbit:queue-arguments>
<entry key="x-dead-letter-exchange" value="hello.activity-task.topic"/>
<entry key="x-message-ttl" value="10000"/>
</rabbit:queue-arguments>
</rabbit:queue>
So i had to go and delete the queue from Rabbit MQ and create with all the required values manually to make it work .
Can anyone help me if there is any option to solve this issue ???
You have to explicitly declare the queue and exchange...
This assumes you routed the original message using the default direct exchange (routing by queue name). Hence the dead letter routing uses the same routing key (queue name). If you route using an explicit routing key, you would use that.
By the way, the
RabbitTemplate
does not declare these elements, it's theRabbitAdmin
instance.