camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Getting JMSConsumer to look for messages every N seconds
Date Mon, 14 Sep 2015 11:58:12 GMT
Or use the timer component to send a message each 10 seconds to a
processor. This processor could use a consumer template to poll the queue
in a loop and send the message to another camel route with a producer
template (using the direct component ).
The consumer template also has a timeout parameter. You can use it to break
out from the loop, if there is no message in the queue.

I think this is an easier - less sophisticated  - solution.

Best,
Christian
Am 27.08.2015 00:59 schrieb "Raul Kripalani" <raul@evosent.com>:

> Currently I think that we only support fixed schedules. So with the cron
> scheduler you could achieve something like: start/resume the route on every
> minute at 00 and 30 seconds, stop/suspend every minute at 10 and 40 seconds
> time marks.
>
> This would effectively keep your route running for 10 seconds every 30
> seconds.
>
> If you want something more sophisticated, like stopping it once the queue
> is empty, you would need to extend what we offer OOTB with your own logic.
>
> Maybe you want to stop the route when t be consumer has been inactive for 1
> second or 500ms, or when queue size is 0 at the broker (checking via JMX).
>
> Raúl.
> On 26 Aug 2015 23:19, "gilboy" <josephotoole@gmail.com> wrote:
>
> > Thanks for the feedback. So just to confirm if I have the following route
> > and
> > I want to consume a message every 30 seconds would I inject in to the
> route
> > a RoutePolicy(e.g. SimpleScheduledRoutePolicy) where I specify the
> > routeStartRepeatInterval(30 seconds). I feel like I am missing something.
> > What shuts down the route etc
> >
> > from("jms:endpointDetails")
> >    .routeId("test")
> >    .routePolicy(policy)
> >    .to("mock:success");
> >
> > Thanks
> > Joe
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Getting-JMSConsumer-to-look-for-messages-every-N-seconds-tp5770986p5770997.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message