Hi @Ravi
To follow on to @TomF 's response I think there might be a confusion in terminology…and that’s because it’s confusing. Solace has the concept of “topics” and “topic endpoints”. What you want to use here is a “topic” to do fanout to multiple consumers. A “topic endpoint” only allows for 1 consumer.
When using the solace Spring Cloud Stream binder you publish to a topic and consume from Queue endpoints. (Note - no “Topic Endpoints”). So it would look something like this:
From your app that gets an error you would publish your error using StreamBridge > which sends to a topic using Persistent messaging:
@Autowired
private StreamBridge streamBridge;
public void sendStopControlMs g > (Exception ex) {
CustomControlMessage ctrlMsg = CustomControlMessage(“STOP”, ex);
streamBridge.send(“command/topic/stop”, ctrlMsg);
}
And in your apps that want to consume that you would just create a Consumer > to receive and act on it + configure the binding to listen on that topic. Under the covers the Solace binder will create a queue that subscribes to that topic.
@Bean
public Consumer handleControlMsg(){
return controlMsg → {
System.out.println("Received CustomControlMessage " + controlMsg );
//Act on the control action.
//You may want this same function to handle start and stop (or pause and resume)
};
}
In the config tell it the topics you want to subscribe to, using wildcards if you desire.
spring.cloud.stream.function.bindings.handleControlMsg-in-0=command/topic/>
Hope that helps!