I'm using SI and SI-AMQP to send message to Rabbit MQ over SI Message Channels. So in my MessageProducer class I will get a handle on a spring integration MessageChannel and use this to send SI messages to an amqp-outbound-channel-adapter. Now the issue I'm facing is when I want to use the amqp outbound channel but I want to provide a routing key dynamically and not at compile time.
My first instinct was to drop back down to the level of the RabbitTemplate as I know this can be done from there. But the downside is I cannot send SI messages via the template, also I cannot specify mapping-headers="*" like I would in the amqp outbound channel adapter. Each request in the system causes one part of the system to dynamically generate queue's with specific routing keys on them based on a UUID and then events must be sent to this specific queue for that given request. At the end of that requests life cycle the queues are destroyed.
My config is as shown below for producing messages
If anyone can even just point me in the right direction that would be great.
<bean id="rabbitTemplate" class="org.springframework.amqp.rabbit.core.RabbitTemplate" >
<constructor-arg name="connectionFactory" ref="connectionFactory" />
<property name="exchange" value="events.topic" />
<property name="routingKey" value="events.routing.key" />
<property name="queue" value="events" />
<int:channel id="outboundEventChannel" />
<bean id="eventsMessageProducer" class="com.idna.events.producer.EventsMessageProducer" >
<property name="outboundChannel" ref="outboundEventChannel" />