QueueReceiver.receiveNoWait() issue?

"Mood, Micah" <[email protected]> Tue, 27 Jun 2006 21:16:52 -0400
Newsgroups gmane.comp.java.openjms.user
Message-ID <CD9D83C38578B94CB2B824207C6A70CE01289BA8@ctcjst-mail2.ad.ctcgsc.org>
Hello,

I have a queue that I am using to hold "in process" information.  I have
no listeners registered on this queue; when I finish processing a
message, I lookup the message in the queue based on a String property
set in the ObjectMessage.

The following is what is happening (with either Derby or Oracle used for
the db):

- Start my app in tomcat.
- Start the queueSession via
createQueueSession(false,session.AUTO_ACKNOWLEDGE)
- Register a sender for the queue
- Put a message in the queue
- Pull the message from the queue by creating a receiver with a message
selector, and then calling receiver.receiveNoWait()

- At this point, I process the message.  Everything seems to be okay.  I
can browse the queue and the message no longer appears in the queue.

- However, if I restart tomcat and then browse the queue again, the
message which I previously consumed now reappears in the queue, which I
did not expect at all.

(note: on application shutdown, I'm calling queueConnection.close() to
release all resources)


My question is, am I wrong in assuming that a queueReceiver with a
message selector, and receiveNoWait, will remove consumed messages from
the queue, and if so, what is the correct method to do this?  Or is this
a bug?


-Mitch


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642