I have what seems to be a correctly configured RabbitMQ queue (shows the dlx argument) and in my Java listener code, I throw a FatalListenerExecutionException
. For some reason, nothing is showing up in the designated dead letter queue after the exception is thrown.
Am I throwing the wrong kind of exception?
Thanks.
Queue instantiation in Spring configuration:
Map arguments = new HashMap();
arguments.put("x-dead-letter-exchange", "dlx.queue");
new Queue("some.queue", true, false, false, arguments);
Listener Container in Spring configuration:
public SimpleMessageListenerContainer
someContainer(){
final SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory);
container.setQueues(createTheQueue());
container.setMessageListener(theListener());
container.setConcurrentConsumers(numberOfConcurrentConsumers);
container.setMaxConcurrentConsumers(maxDefaultConsumers);
container.setDefaultRequeueRejected(false);
return container;
}
Bindings for "some.queue" shown in RabbitMQ console:
Parameters : x-dead-letter-exchange: dlx.queue