0
votes

I'm writing a Java application that uses Spring Cloud Stream to read messages from an input RabbitMQ queue, process the messages, and then write a new message to an output RabbitMQ exchange. This works great when the input queue name is known at compile-time.

I now have a new requirement that the application needs to support discovering new RabbitMQ queues at runtime, and then use those new queues for input (reading messages from the new queues). Getting the list of queues is straightforward via the REST API in RabbitMQ, but I don't see a way to use a variable queue name for reading messages from those new input queues.

I'm using Spring Cloud Stream v.3.0.3. Does Spring Cloud Stream support this use case?

1

1 Answers

1
votes

No, s-c-stream was never designed for cases like this. Sure the API to register new bindings is there and one can certainly accomplish that, but sooner or later there will be a question of destination configuration as well as other fine-print-style details and those would need to be known in advance regardless. In all this would also IMHO contradict the fundamental ideas and ideals behind the concept of microservices - do only one thing, but do it well and in the simples way possible. What you are describing doesn't seem to fit in that category