Re: QueueReceiver.receiveNoWait() issue?

Tim Anderson <[email protected]> Wed, 28 Jun 2006 21:58:39 +1000
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
Its a known bug. See 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1480739&group_id=54559 


You can use receive(1) instead of receiveNoWait() as a workaround.

-Tim

Mood, Micah wrote:
> 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
> _______________________________________________
> openjms-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openjms-user
>
>   

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