0
votes

I use rabbitmq in production and QPid in integration tests. I need to write integration test which verify that return channel is called for unroutable messages. I set mandatory=true and unbind queue and exchange, however nack channel is called (NackedAmqpMessageException is thrown) instead of return channel. Return channel is never called.

I use Spring AMQP with Spring Boot + Spring Integration. How can I produce return channel case in tests?

I use the versions:

Qpid 7.1.4
Amqp client 5.4.3
Spring Integration 5.1.9
Spring Boot 2.1.2

Thank you.

1
Using QPID for testing is sub-optimal; it does not support all the RabbitMQ extensions (I am not sure if that's the problem here). Consider using a real RabbitMQ instance, e.g. using TestContainers instead. - Gary Russell

1 Answers

1
votes

Is there a confirmation that QPid supports Publisher Confirms: https://www.rabbitmq.com/confirms.html#publisher-confirms ? To be honest we recommend to use RabbitMQ even for tests. See our recent sample how to do that with Testcontaniers: https://github.com/spring-projects/spring-integration-samples/tree/master/intermediate/testcontainers-rabbitmq