camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Consuming messages based on a predicate
Date Fri, 07 Jan 2011 11:46:48 GMT
On Fri, Jan 7, 2011 at 12:20 PM, Martin Gilday <> wrote:
> Hi,
> I am building a Camel route which consumes from a JMS queue, does JSON
> to XML conversion and then calls a web service to send requests to a
> third party.  This third party only wants to receive the messages during
> their opening hours.  This made me immediately think to use the Quartz
> component to consume during certain hours.  However their opening hours
> change frequently, and we have a database table which stores the current
> schedule. There is a nice service with a method isOpen() which can
> determine whether they are open currently.  If I take the message off
> the queue and then check the predicate it could be looping the messages
> around for hours or days at a time until they are open.
> Is there a nice way to create a route to do this?

Something similar to

But instead just implement your own "scheduling" logic. For example
have a background thread invoke once a minute or something and
determine if its open. And then suspend/resume the route accordingly.

> Thanks,
> Martin

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message