users@glassfish.java.net

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

From: Trond Strømme <Trond.Stromme_at_Sun.COM>
Date: Mon, 05 Oct 2009 11:15:17 +0200

Hi.
Have you looked at the OpenESB components, more specifically the
SchedulerBC, the BPELSE and the JMSCB? (openesb.dev.java.net)
With the scheduler BC you can have a cron-like job that fires on
selected intervals. A business process will pick up the trigger,
Writing a simple EJB that hooks into JMX you an look up the queue's
MBean, get the number of messages in the queue, feed this to a BPEL
process that does a JMS On Demand Receive to pull any number of messages
off the queue in a loop.
To reuse the MDB you've already got have the business process pull
messages of the main queue and into an intermediate queue for immediate
processing by the same MDB.

.trond
glassfish_at_javadesktop.org wrote:
> Hi Folks,
>
> I have setup a queue using Glassfish's admin console along with a connection factory and have some basic code written to send messages to a queue and have them read using an MDB. All that is fine and works well. However, what I really want to do further on from this is for Glassfish's JMS to poll the queue every hour and then notify the MDB (via it's MessageListener interface) so that it reads the message from the queue. In effect, the MDB will be consuming messages every hour instead of being notified everytime a message arrives within the queue.
>
> Can this be done using Glassfish JMS or should it be done programatically? Any help and advice is appreciated.
>
>
> Regards,
>
> John
> [Message sent by forum member 'johnstv' (johnstevens3_at_hotmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=366699
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>