I want to automatically read/receive messages from solace queue/topic if any message produced or published when my application is up. So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic.
Asked
Active
Viewed 903 times
0
-
1Why would you want to connect only when there is a message ? The standard model of JMS is that you create a connection and create your consumer and it will notify you if there is a message. Check out for example: https://www.journaldev.com/9789/jms1-producer-and-consumer – Axel Podehl Jul 19 '19 at 07:28
1 Answers
2
So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic
This is not possible for JMS. JMS applications initiate a connection to the broker and receive messages over the locally initiated connection.
The only way to do what you want is to use REST instead of JMS. When a REST consumer is configured, the Solace event broker will initiate a HTTP connection to the application.
A sample can be found here: https://solace.com/samples/solace-samples-rest-messaging/publish-subscribe/

Russell Sim
- 1,693
- 2
- 14
- 22