You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Kranti Parisa <kr...@gmail.com> on 2015/01/27 02:18:57 UTC

ServiceStatus isProcessing?

Hi,

Is there a way to identify if a given route is currently processing any
messages or not?

I want to run 2 routes which are independent in terms of the incoming data
sources but I want to execute each of them only if the other is not
processing anything as they both update the same end point (output)
If there an alternative approach than checking the in-flight message count?
And I think it would be helpful to add isProcessing flag to
the ServiceStatus, thoughts?


Thanks,
Kranti

Re: ServiceStatus isProcessing?

Posted by Kranti Parisa <kr...@gmail.com>.
Hi Jens,

Thanks for the reply. Using a queue for writing/reading some flags is
already in my mind. But wanted to check with the community if there is a
way thru the Camel APIs. I got your points and that makes sense.


Thanks,
Kranti

On Mon, Jan 26, 2015 at 10:21 PM, mailinglist@j-b-s.de <mailinglist@j-b-s.de
> wrote:

> Hi Kranti,
>
> from our experience relying solely on the inflight repo won't work,
> because even it's empty you may have pending messages in other components
> eg aggregator or sequencer or queues. Afaik there is no central camel
> service existing to check if all work is entirely finished so it depends on
> the components you use in your route(s) to find an answer for "how many
> unprocessed messeges are still caught in the system"...
>
> But maybe you can use a lock (externally as file, or if you only use one
> VM use java synchronization methods)?
>
> Or you can use a queue where both routes add their message to thus forcing
> a serialized processing?
>
> Jens
>
>
> Von meinem iPhone gesendet
>
> > Am 27.01.2015 um 02:18 schrieb Kranti Parisa <kr...@gmail.com>:
> >
> > Hi,
> >
> > Is there a way to identify if a given route is currently processing any
> > messages or not?
> >
> > I want to run 2 routes which are independent in terms of the incoming
> data
> > sources but I want to execute each of them only if the other is not
> > processing anything as they both update the same end point (output)
> > If there an alternative approach than checking the in-flight message
> count?
> > And I think it would be helpful to add isProcessing flag to
> > the ServiceStatus, thoughts?
> >
> >
> > Thanks,
> > Kranti
>

Re: ServiceStatus isProcessing?

Posted by "mailinglist@j-b-s.de" <ma...@j-b-s.de>.
Hi Kranti,

from our experience relying solely on the inflight repo won't work, because even it's empty you may have pending messages in other components eg aggregator or sequencer or queues. Afaik there is no central camel service existing to check if all work is entirely finished so it depends on the components you use in your route(s) to find an answer for "how many unprocessed messeges are still caught in the system"...

But maybe you can use a lock (externally as file, or if you only use one VM use java synchronization methods)?

Or you can use a queue where both routes add their message to thus forcing a serialized processing?

Jens


Von meinem iPhone gesendet

> Am 27.01.2015 um 02:18 schrieb Kranti Parisa <kr...@gmail.com>:
> 
> Hi,
> 
> Is there a way to identify if a given route is currently processing any
> messages or not?
> 
> I want to run 2 routes which are independent in terms of the incoming data
> sources but I want to execute each of them only if the other is not
> processing anything as they both update the same end point (output)
> If there an alternative approach than checking the in-flight message count?
> And I think it would be helpful to add isProcessing flag to
> the ServiceStatus, thoughts?
> 
> 
> Thanks,
> Kranti