RE: Non-destructive listener?
<Nicolaus.Bauman-SWCg6hSX5lit/[email protected]>
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <3909DD5F2046C14687CC38B3C641FE45138FE7@msgswbmnmsp34.wellsfargo.com> |
> > From: Nicolaus.Bauman-SWCg6hSX5lit/[email protected] > > > > I totally agree, my needs are much better suited for topics. > > Alas, I don't have that choice. > > > > One last question: the approach you describe works because > > while the browser scans for a message on the queue, it locks > > the messages until the scan is complete. Is that a correct > > assumption? If so, then, yeah, that does sound VERY > > resource-intensive. > > > > Thanks so much for such a clear and succinct response. > > The browser doesn't lock the queue. The approach works because > the browser is used to scan the queue, and individual messages are > subsequently synchronously consumed using a QueueReceiver. > > E.g, suppose the queue contains messages A, B, and C. > Using a queue browser, you determine you want to consume message B. > So you construct a QueueReceiver with a selector: > "JMSMessageID='" + B.getJMSMessageID() + "'" > and consume the message using the receive() method. > That leaves messages A and C in the queue. > If message D is subsequently added to the queue, a subsequent > scan with a browser will see messages, A, C, and D. > > Its resource intensive in that you need to continuously scan the queue > to pick up new messages. > > -Tim First of all, thank you for taking time to explain this. I can't remember when I have gotten better support from any software community, let alone individual, on any product or system I've been concerned with. This is so cool. Furthermore, if the community support is already this good, one can only guess at how much better the actual engineering implementation is. Secondly, now perhaps I'm just as thick as a whale omlet, but what you describe seems to indicate that the browser can _still_ miss a message if another Listener is listening on the queue. Is this a wrong assumption? Thanks again, Nicolaus Bauman Developer: TIR - SPS * 612.667.2170 * 612.232.7120 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php