0

I am trying to create dynamic n Number of Queues using StreamBridge SpringBoot with RabbitMQ as broker I previous created queue using this method

application.properties

spring.cloud.stream.bindings.sender-in-0.destination=sampleQueue
spring.cloud.stream.bindings.sender-in-0.group=processor
spring.cloud.stream.bindings.sender-out-0.destination=sampleQueue
spring.cloud.stream.bindings.sender-out-0.group=consumer
spring.cloud.stream.bindings.user-in-0.destination=sampleQueue
spring.cloud.stream.bindings.user-in-0.group=consumer
spring.cloud.stream.bindings.publisher-out-0.destination=sampleQueue
spring.cloud.stream.bindings.publisher-out-0.group=processor

and Having a Producer , Processor and Consumer functions

I have no idea how to dynamically create 1 Producer with 500 queues to 500 consumers do I have to config bindings like this is for all 500 or is there any easier method with a loop Queue names could be SampleQueue1,SampleQueue2 so on....

Thanks in Advance

1 Answers1

1

There is no need to create them ahead of time. Output bindings will be created dynamically, on-demand, see

https://docs.spring.io/spring-cloud-stream/docs/current/reference/html/spring-cloud-stream.html#_streambridge_and_dynamic_destinations

Gary Russell
  • 166,535
  • 14
  • 146
  • 179