1
votes

I have Spring XD Rabbit source in my stream definition but it will fail when the queue it's listening is not yet created. When I am using Spring Integration Boot I am able to do this in my JavaConfig.

My stream definition: stream create --name HOLA_Q --definition "rabbit --requeue=false | my-own-processor | null" --deploy

I have tried using rabbit admin in my spring-module.xml inside my-own-processor but doesn't work or get triggered during stream deployment.

Or is this rabbit queue auto creation feature not yet supported?

Many Thanks

1

1 Answers

0
votes

Auto creation of the queue by the source is not currently supported.

Per the documentation:

The queue(s) must exist before the stream is deployed. We do not create the queue(s) automatically. However, you can easily create a Queue using the RabbitMQ web UI. Then, using that same UI, you can navigate to the "rabbittest" Queue and publish test messages to it.

You could create a custom rabbit source that adds the queue (and an optional exchange and binding), as well as a RabbitAdmin bean to the application context and the queue/exchange/binding will be declared.