This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Control Message in JMS  RSS feed

 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could anyone tell me what to use for a "end of Message" marker for sending messages in a a JMS queue? I'm looking for some best practices, or something of the sort.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean you want to send a single logical message split over many actual JMS messages? If so, you might want to look at something like ActiveMQ's grouping capabilities.
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I meant that I want to send a sort of end-of-message marker for a set of messages in the queue that tells the code on the other end that it can stop listening, and was wondering about best practices on the issue.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if this is a normal JMS listener (i.e. single threaded) you can just send this message and write code to do whatever you want. This will not work in a multi threaded environment (you have no control over which messages gets processed first there), hence my ActiveMQ groups recommendation.
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Er,I really don't know much about ActiveMQ, (I'm just learning JMS). Could you point me to some resources?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here it is.
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, will check, and thanks a lot for the help.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!