Reputation: 1179
I am using spring cloud stream with rabbitMQ. I am trying to do the negative test by deleting the queue on runtime and post the message to the deleted queue.
source.queue2Source().send(MessageBuilder.withPayload(queue4DTO).build());
I am listening message from queue 1 and posting the message to queue 2( deleted one). I was expecting that above code will throw an exception but it is not. Even the message from reading from queue 1 has been acknowledged. I have a dead letter queue on queue 1 and queue 2 but message not went into dlq.
Upvotes: 0
Views: 246
Reputation: 6106
That is because the you are sending message to a channel
defined by the Source
. The channel actually does exist and is bridged via AMQPOutboundChannelAdapter to an exchange which by default will drop undeliverable messages.
Upvotes: 0