Check that file component is still polling

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Check that file component is still polling

Bengt Rodehav
I've had problems with the "sftp" component stopping to poll. Last week,
for the first time, we encountered the same situation with the "file"
component. It doesn't happen very often and I haven't been able to figure
out what the cause is.

We're currently running Camel 2.10.3 on Karaf 2.3.0 but we've had the same
situation (with sftp) with earlier versions of Camel as well as Karaf.

I would like to monitor my routes to make sure they are still working. E g
everytime a poll is made using sftp I would like to send a heartbeat to a
monitoring server (Nagios). I can then track the situation where a route is
"hung". How can I do this? It's easy to send a heartbeat everytime a file
is acutally downloaded - I just put that processing later in the route.
But, if I poll does not result in downloading a file, I never leave the
file component for further processing in the route.

/Bengt
Reply | Threaded
Open this post in threaded view
|

Re: Check that file component is still polling

Preben.Asmussen
Hi Bengt

On file endpoint you can enable sendEmptyMessageWhenIdle option that sends an empty message if no files are available. This should also be possible on ftp/sftp endpoints, and could trigger your route to send a heartbeat even in the absence of a file exchange.

An other way to achieve monitoring is to let your Camel context/routes be able to tell it's health state, so that each camel integration component exposes a rest interface with health state info.
We are deploying in a war file so it's easy to expose a rest interface, and for whatever monitoring solution to call http get and take action depending on the healthstate.

If you are running your routes as bundles in karaf, you could possible expose the same healthstate info as MBeans, and then let Nagios query via jmx.

/Preben

   

Reply | Threaded
Open this post in threaded view
|

Re: Check that file component is still polling

Bengt Rodehav
Thanks a lot for your detailed reply Preben!

The "sendEmptyMessageWhenIdle" option sounds exactly what I was looking
for. The other option you mention sounds interesting as well. How can I
make a context/route report its health state via JMX? I know that Camel can
be queried and controlled via JMX but how would it be possible to, e g,
detect that the ftp component has stopped polling?

Or perhaps you mean that I would detect it using the "
sendEmptyMessageWhenIdle" but report it via JMX?

In my case I need to use Nagios in a passive configuration since we do not
allow incoming traffic to the server. Therefore my Camel routes need to
actively report both failures and heartbeats. A REST API won't fit the bill.

/Bengt


2013/2/11 Preben.Asmussen <[hidden email]>

> Hi Bengt
>
> On file endpoint you can enable sendEmptyMessageWhenIdle option that sends
> an empty message if no files are available. This should also be possible on
> ftp/sftp endpoints, and could trigger your route to send a heartbeat even
> in
> the absence of a file exchange.
>
> An other way to achieve monitoring is to let your Camel context/routes be
> able to tell it's health state, so that each camel integration component
> exposes a rest interface with health state info.
> We are deploying in a war file so it's easy to expose a rest interface, and
> for whatever monitoring solution to call http get and take action depending
> on the healthstate.
>
> If you are running your routes as bundles in karaf, you could possible
> expose the same healthstate info as MBeans, and then let Nagios query via
> jmx.
>
> /Preben
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Check-that-file-component-is-still-polling-tp5727333p5727363.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Check that file component is still polling

Preben.Asmussen
We use Camel's jmx statistics to determine the health state.

1. if here has been an completed exchange within a given timeframe eg. 10  min. everything is ok. if the last exchange was a failure healthstate is set to error.

2. if no exchange has been completed a secondary check is activated. This is a custom resoucecheck eg. at ftp or file checker, that checkes that no unconsumed files exists. (they should have been consumed if the route was running ok). If unconsumed files exists an error is reported.

The last one would catch your situation where your route suddenly stops consuming.

You could have some kind of supervisor service running locally on the box, that on intervals checks all your routes and publishes health state to nagios.
Reply | Threaded
Open this post in threaded view
|

Re: Check that file component is still polling

Bengt Rodehav
Thanks Preben - good advice,

/Bengt


2013/2/12 Preben.Asmussen <[hidden email]>

> We use Camel's jmx statistics to determine the health state.
>
> 1. if here has been an completed exchange within a given timeframe eg. 10
> min. everything is ok. if the last exchange was a failure healthstate is
> set
> to error.
>
> 2. if no exchange has been completed a secondary check is activated. This
> is
> a custom resoucecheck eg. at ftp or file checker, that checkes that no
> unconsumed files exists. (they should have been consumed if the route was
> running ok). If unconsumed files exists an error is reported.
>
> The last one would catch your situation where your route suddenly stops
> consuming.
>
> You could have some kind of supervisor service running locally on the box,
> that on intervals checks all your routes and publishes health state to
> nagios.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Check-that-file-component-is-still-polling-tp5727333p5727426.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>