• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS "welcome" message?

 
hernan silberman
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on a system where applications receive notifications each time an important shared object's state changes. This object is like the menu at a restaurant--whenever it changes all of the restaurant employees receive a new message with the updated menu they should use from that point forward.

What I'd like to do is send them the most recent message as soon as they subscribe to the topic with the latest version of the menu so that I don't have to provide it to them by other means or equip them to find it on their own.

I'm sort of new to JMS--let me know if there's a standard mechanism or practice for doing this. At this time I'm planning on having each client send a request message to a dedicated queue when they start up and then wait until they receive the initial object on a separate response queue to simulate a synchronous request/response.

thanks...
Hernan
 
hernan silberman
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just in case it's useful for others, I ended up doing the following when each client starts up:

1) Create a temporary queue and consumer to receive a response on.
2) Send a request message to a well known request queue asking for the current "menu" object. This request message includes the name of the temporary response queue in a string property.
3) Do a blocking consumer.read() on the temporary response queue.
4) Delete the temporary queue.
5) Subscribe to a topic to receive updates to the "menu" object.

This was pretty easy to do and the resulting code is simple. Let me know if you have any improvements spot any potential issues with this approach.

thanks...
hernan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!