You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ivana Cace <iv...@yarden.nl> on 2017/12/29 15:04:12 UTC

How to stop polling at unreachable (smb) file endpoint

We have a camel route that picks up files at an smb endpoint when the application starts, moves them, sends an email and then the application closes down.
If there are no files to pick up, an email is send, and the application closes down. To enable this we set sendEmptyMessageWhenIdle=true on the source-location.

Problems arise if the smb location is unreachable for some reason, for example if the configuration has set an unauthorised user or an invalid password.
In this case the ScheduledPollConsumer keeps on polling.

The reason is Thread keeps calling ScheduledPollConsumer.run, that is, GenericFileConsumer.poll exits, only to be called again and again.
The exception doesnt (cannot) propagate back to the caller for this reason there is no point in extending PollingConsumerPollStrategy and implementing rollback.

How can i solve this? Maybe the pollingconsumer should also send an empty message on error? Or stop the route in some other way?

Happy 2018!

***************************************** De informatie verzonden in deze e-mail (inclusief bijlagen) kan vertrouwelijk van aard zijn en is uitsluitend bestemd voor de geadresseerde(n). Indien deze e-mail niet voor u bestemd is, verzoeken wij u vriendelijk het bericht te retourneren en vervolgens te vernietigen. Yarden doet er alles aan om ervoor te zorgen dat verzonden e-mailberichten vrij zijn van virussen, maar kan dit niet garanderen. Yarden Holding B.V., statutair gevestigd te Almere, Handelsregisternummer 34155452 Yarden Uitvaartfaciliteiten B.V., statutair gevestigd te Almere, Handelsregisternummer 30104432 Yarden Uitvaartzorg B.V., statutair gevestigd te Almere, Handelsregisternummer 04050164 Yarden Uitvaartverzekeringen N.V., statutair gevestigd te Almere, Handelsregisternummer 33244450 *****************************************

Re: How to stop polling at unreachable (smb) file endpoint

Posted by Pontus Ullgren <ul...@gmail.com>.
Hi,

Clause is absolutely correct that Camel Extra[1] is a separate project and
you are very welcome to post on that projects mailinglist.

However this is a functionality that the defined in camel core so I will
answer here anyway.

As with any other endpoint you can set bridgeErrorHandler=true on the
endpoint.

   from("smb:DOESNOTEXIST/inputshare?bridgeErrorHandler=true")

You can then handle the exceptions that arises in the consumer in a error
handler just as with other errors that occur during processing.

[1] https://camel-extra.github.io/

Best regards
Pontus Ullgren




On Wed, 3 Jan 2018 at 14:58 Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> You need to report this to camel-extra as the smb component is from
> them, not from the official Apache Camel project.
>
>
> On Fri, Dec 29, 2017 at 4:04 PM, Ivana Cace <iv...@yarden.nl> wrote:
> > We have a camel route that picks up files at an smb endpoint when the
> application starts, moves them, sends an email and then the application
> closes down.
> > If there are no files to pick up, an email is send, and the application
> closes down. To enable this we set sendEmptyMessageWhenIdle=true on the
> source-location.
> >
> > Problems arise if the smb location is unreachable for some reason, for
> example if the configuration has set an unauthorised user or an invalid
> password.
> > In this case the ScheduledPollConsumer keeps on polling.
> >
> > The reason is Thread keeps calling ScheduledPollConsumer.run, that is,
> GenericFileConsumer.poll exits, only to be called again and again.
> > The exception doesnt (cannot) propagate back to the caller for this
> reason there is no point in extending PollingConsumerPollStrategy and
> implementing rollback.
> >
> > How can i solve this? Maybe the pollingconsumer should also send an
> empty message on error? Or stop the route in some other way?
> >
> > Happy 2018!
> >
> > ***************************************** De informatie verzonden in
> deze e-mail (inclusief bijlagen) kan vertrouwelijk van aard zijn en is
> uitsluitend bestemd voor de geadresseerde(n). Indien deze e-mail niet voor
> u bestemd is, verzoeken wij u vriendelijk het bericht te retourneren en
> vervolgens te vernietigen. Yarden doet er alles aan om ervoor te zorgen dat
> verzonden e-mailberichten vrij zijn van virussen, maar kan dit niet
> garanderen. Yarden Holding B.V., statutair gevestigd te Almere,
> Handelsregisternummer 34155452 Yarden Uitvaartfaciliteiten B.V., statutair
> gevestigd te Almere, Handelsregisternummer 30104432 Yarden Uitvaartzorg
> B.V., statutair gevestigd te Almere, Handelsregisternummer 04050164
> <040-501%2064> Yarden Uitvaartverzekeringen N.V., statutair gevestigd te
> Almere, Handelsregisternummer 33244450
> *****************************************
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: How to stop polling at unreachable (smb) file endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You need to report this to camel-extra as the smb component is from
them, not from the official Apache Camel project.


On Fri, Dec 29, 2017 at 4:04 PM, Ivana Cace <iv...@yarden.nl> wrote:
> We have a camel route that picks up files at an smb endpoint when the application starts, moves them, sends an email and then the application closes down.
> If there are no files to pick up, an email is send, and the application closes down. To enable this we set sendEmptyMessageWhenIdle=true on the source-location.
>
> Problems arise if the smb location is unreachable for some reason, for example if the configuration has set an unauthorised user or an invalid password.
> In this case the ScheduledPollConsumer keeps on polling.
>
> The reason is Thread keeps calling ScheduledPollConsumer.run, that is, GenericFileConsumer.poll exits, only to be called again and again.
> The exception doesnt (cannot) propagate back to the caller for this reason there is no point in extending PollingConsumerPollStrategy and implementing rollback.
>
> How can i solve this? Maybe the pollingconsumer should also send an empty message on error? Or stop the route in some other way?
>
> Happy 2018!
>
> ***************************************** De informatie verzonden in deze e-mail (inclusief bijlagen) kan vertrouwelijk van aard zijn en is uitsluitend bestemd voor de geadresseerde(n). Indien deze e-mail niet voor u bestemd is, verzoeken wij u vriendelijk het bericht te retourneren en vervolgens te vernietigen. Yarden doet er alles aan om ervoor te zorgen dat verzonden e-mailberichten vrij zijn van virussen, maar kan dit niet garanderen. Yarden Holding B.V., statutair gevestigd te Almere, Handelsregisternummer 34155452 Yarden Uitvaartfaciliteiten B.V., statutair gevestigd te Almere, Handelsregisternummer 30104432 Yarden Uitvaartzorg B.V., statutair gevestigd te Almere, Handelsregisternummer 04050164 Yarden Uitvaartverzekeringen N.V., statutair gevestigd te Almere, Handelsregisternummer 33244450 *****************************************



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2