users@glassfish.java.net

Re: How do you poll a Glassfish JMS queue say every hour?

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 Oct 2009 03:27:51 PDT

Thanks everyone for their suggestions to this issue and I'll certainly look into all of them :)

The one which interests me the most is Frank's suggestion of using a JMS selector property "doNotProcessBefore". So ideally for my scenario there would be a property called "retryNumber" which will contain the number of times the message as been read and processed by the MDB in addition to something like "lastTimeProcessed" so that it can figure out how many retries were made within an hour. But there's one thing which I'm assuming here and that's the update of the "retryNumber" property. Can an MDB change the value of a message such as "retryNumber" for it to be picked up again by the selector?

At the same time I'm aware that if a message satisfies the number of retries within an hour then I'd need to remove it (transactional commit) from the queue. All this is within a business process context and not any kind of infrastructure problem whereby, I believe, "endpointExceptionRedeliveryAttempts" and "sendUndeliverableMsgsToDMQ" come into play with messages that simply can be delivered and/or consumed.

I have to be honest and say that I'm not using EJB3 but Spring but hopefully that shouldn't affect anything. I already have a queue up and running and am successfully sending/consuming messages via an MDP (Spring MDB POJO).

Many thanks again for any help you can give.


John
[Message sent by forum member 'johnstv' (johnstevens3_at_hotmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=367106