• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Non destractive read from Queue

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way in Websphere to read the message from MQ Queue in browse mode. MQI allows it, but I am not sure if JMS supports this or not?
Is there any way to achieve this in WAS via JMS?
This is needed as I want to delete the message from Queue only after I am done reading the message. As message is long in size and it would be read segment by segment and in case it fails in the middle, I need to start over from segment 1. That is possible only if I read the message in browse mode?
 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ranvir Dalal:
Is there any way in Websphere to read the message from MQ Queue in browse mode. MQI allows it, but I am not sure if JMS supports this or not?
Is there any way to achieve this in WAS via JMS?
This is needed as I want to delete the message from Queue only after I am done reading the message. As message is long in size and it would be read segment by segment and in case it fails in the middle, I need to start over from segment 1. That is possible only if I read the message in browse mode?



If you read the message in a transaction, e.g. in a message driven bean, then the read should be atomic. If it fails part the way through, the transaction will roll back and the message will still be on the queue.

You could read messages non destructively from a queue by browsing them. Check out the JMS docs. One thing to be aware of when browsing MQ queues is that there used to be a bug whereby if you didn't browse all messages a resource would not be released, and eventually you'd run out. This may well have been fixed ( it was on WebSphere MQ 5 )
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be if you acknowledge the message only after you have finished processing, will do the trick.
 
Don't MAKE me come back there with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic