• Post Reply Bookmark Topic Watch Topic
  • New Topic

Questions on JMS  RSS feed

 
Steven Jiang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All, I am newbie to JMS, I read a few articles and finally got a few questions to help me cear my mind on JMS

1. for Queue, if one message is sent to the Queue, another consumer picks up, so the message is gone right??? another consumer connecting to the queue wont get anything, my understanding is right?

2. for Topic, because a few consumer can subscribe to one topic, so they can get the message from the topic, but when the Provider clean the message? they can not keep them forever right???

3. for topic, if the user connects to topic and get message, disconnect and connect again, does he get message again or....nothing happens because he has got the message already, what happens if another new message was put in the topic queue before client reconnect to the queue??? does client only get new message???

Thank you so much. Just wanna understand the basic flow of JMS.

Steve
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer for your first question is Yes . Your understanding is right .

Reading/Retreiving a Message is equal to removing the message from the Queue.


I don't know much about Topic
 
Steven Jiang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PavanPL KalyanK wrote:The answer for your first question is Yes . Your understanding is right .

Reading/Retreiving a Message is equal to removing the message from the Queue.


I don't know much about Topic


Thanks a lot for your help
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note
queue is Point to Point and
Topic is Publisher Subscriber.

Means Queu is used for one to one and Topic is used for one to Many.

1. There is a concept of durable subscriber in case of Topic. If you have connected to a Topic and you got the message and until unless you don't tell topic you have taken the mesage, message will be present on the topic. You can tell the topic by using autoacknowledge mode of JMS and doing a commit on topic to indicate you have got the message.

2. In case you are using durable subscriber and you ahve two subscriber for the same topic then there will be message for both the suscriber on the topic until both have consumed there messages. It something like guarenteed delivery of messages.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!