1
votes

Our application has an amqp inbound-channel-adapter with a listener container where we dynamically add and remove queue names.

We would like to utilize RabbitMQ's BCC (Sender-selected Distribution) feature where you set the BCC header to a Collection of recipient routing keys. This would be beneficial to have RabbitMQ distribute the messages instead of having Spring Integration create copies (could be thousands) and send them individually.

The problem is that when RabbitMQ sends the message it removes the BCC field, as expected, and does not put the recipient's routing key in the received routing key header. Also, there appears to be no way to map the message to the queue that it came from. Therefore the application has no idea "who" the message is intended for (queue-name/routing-key of queue it came from).

Previously we had used the received routing key to identify the recipient.

We had thought about 2 approaches.

1) Dynamically create an inbound channel adapter for each queue that needs to be listened to that has a dynamically created header enricher to add a recipient header = queue name it is listening to.

2) Dynamically create a sub-classed listener container that contains a queue name property that sends its messages to a gateway to get it back into the integration flow.

Could someone help us to determine what queue our message came from without a received routing key header?

1
Isn't AmqpHeaders.CONSUMER_QUEUE enough for you? It is available since SI-4.1.2 and S-AMQP-1.4.2Artem Bilan
Well that would be the problem. I am using spring boot starter parent 1.2.1.release and it only gave me SI 4.1.4 and S-AMQP 1.4.1. I shall upgrade. Thanks for the help.Kevin - NOAA Affiliate

1 Answers

0
votes

Artem Bilan was correct and I was using an older version of S-AMQP which did not support that attribute. I upgraded to S-AMQP 1.4.2 and my CONSUMER_QUEUE property was there.