• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remove JMS message from Queue programatically

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

I am using jboss AS 5.0, and need to delete a message from queue.

I am using spring as well in the application, with a task scheduler which hits a method which basically gets messages in the queue.

What I want is, after I am done with processing messages in the queue (messages returned by QueueBrowser enumeration), I want them to be deleted from the queue.

I think the JMS spec does not provide this facility, but just want to know if JBOSS Messaging provides this facility ?

Here is the code




This method is called by the scheduler each 15 minutes to see if there are messages available in the queue. If there are some, it does something with them and would try to have them removed, so that the next call to this method will not show the same message which has already been processed earlier.
One more thing, if I manually acknowledge the message, I get an IllegalStateException.
 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone going through the same scenario ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic