Solace Community is getting a facelift!
On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.
We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!
Get topic name from the incoming message using solace spring cloud stream library
Following is a sample bean to receive messages from a solace queue. How can I get the topic name through which the message came into my queue?
This queue is configured to receive messages from multiple topics and based on the topic of each message I have different message processing logic.
I was able to get the topic name using this.message.getDestination().getName() method when I was using sol-jcsmp library.
In spring cloud stream library, how can I get this information?
@Bean
public Consumer<Message<?>> logMsg() {
return message-> {
System.out.println("Received: " + message);
};
}
Comments
-
Hi @matthesu,
This is currently a short coming of the binder. We have this issue opened in github to track it and the plan is to enhance the binder with this functionality in the release after next. If you could get your team to open a support ticket to request this functionality that would help me get it prioritizedNote the next release will be available soon ( within a week I'm thinking🤞) with support for publishing to dynamic topics and consumer concurrency.
-Marc
0