• Post Reply Bookmark Topic Watch Topic
  • New Topic

MESSAGES FROM Topic  RSS feed

 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i wrote a standard application in JMS. i had a servlet which publishes message to a topic and a Message Driven Beans whose onMessage will get fired whenever a message comes in the topic. This is synchronous application. What if i want to asynchronus communication. for example the servlet publishes a ten message to the topic and at that time the MDB was not running. is there any way i get all the messages which were posted in the topic at once. if i am right,i cant use the mdb for this asynchronous communication. do i need to write down an ejb for this. Does the topic object have a mehtod like getAllMessages for example which gets all the messages posted in the topic at one. any help on this or a link to the tutorial which explains this will be appreciated.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to read in a JMS book or the JMS spec about durable subscriptions. It's hard to understand what you're looking for, but I think that's it.
Kyle
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For synchronous messaging, the consumer must be either a QueueReceiver or TopicSubscriber. For asynchronous messaging, the consumer must be a MessageListener. A message-driven bean is a type of MessageListener as it implements MessageListener, so you can use a message-driven bean for your asynchronous messaging.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to reliable delivery promised by some of the 3rd party middleware vendors or app server providers like Weblogic to enable this.
They will have documentation that can be used to enable getting the waiting messages when the MDB comes alive.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!