You receive an error message when using Spring AMQP send a message to the RabbitMQ:
inequivalent arg 'x-queue-type' for queue 'com.ossez.real.estate' in vhost '/': received none but current is the value 'classic' of type 'longstr', class-id=50, method-id=10
The above error message is very clear, indicating that the transmitted message queue parameter less x-queue-type this parameter.
In the code, we create a queue parameters as follows:
return new Queue(MY_QUEUE_NAME, NON_DURABLE);
This directly create less args.put ( "x-queue-type", "classic") queue parameters;
Therefore, we need to add the above parameters when creating the queue.
Modify the code as follows:
Map<String, Object> args = new HashMap<>();
// // set the queue with a dead letter feature
args.put("x-queue-type", "classic");
return new Queue(MY_QUEUE_NAME, NON_DURABLE, false, false, args);
Please refer to GitHub code: