0

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.

Rahman Usta
  • 716
  • 3
  • 14
  • 28
  • 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](https://www.testcontainers.org/modules/rabbitmq/) instead. – Gary Russell Apr 10 '20 at 13:59

1 Answers1

1

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

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118