• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why JMS message gets locked after processed.  RSS feed

 
Vighnesh Mu
Greenhorn
Posts: 29
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an JMS application, the requirement is like read message from a JMS queue and do some operation,if that operation fails put the message back on queue and process again after some time(like after 5 mins or 10 mins). I have to retry processing the same message say 3 times in an hour time,but what is happening is once I process and put back the message on queue the state of message gets "Locked" so it won't allow to retry after 5 0r 10 mins. Does anybody knows why the message getting locked on queue and how to resolve these kind of issues?

I am closing all open resources like session,transaction etc related to queue connection.

Following is code snippet for reference -

Putting back message on queue -

Receiving message from queue -

Thanks in advance.

Vighnesh.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check if your JMS provider has settings for message retention duration. I believe, decreasing this value should remove the message once it is read from the JMSQ.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!