I'm working on a Java application which uses Spring Boot version 2.0.4.RELEASE and RabbitMQ version 3.7.7. The app is caching all the messages from the RabbitMQ in Redis database and has to resend when a new Queue is created in RabbitMQ. Currently, I managed to capture the Queue creation using Event Exchange Plugin and also the Queue name. I am using AMQP outbound adapter to send the messages back to RabbitMQ.
OutFlow
public IntegrationFlow outFlow(AmqpTemplate amqpTemplate) {
return IntegrationFlows.from(outputChannel())
.handle(Amqp.outboundAdapter(amqpTemplate)
.routingKeyExpression("headers.routingKey")
.exchangeNameExpression("headers.exchange"))
.get();
}
I can send the messages to specific exchange with the routingKey. But, I don't know how to configure the Queue name in the outbound adapter. So that I can send the message to that specific Queue.