camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vishal1981 <>
Subject Customer PollingConsumerPollStrategy but with message header or exchange property
Date Wed, 15 Aug 2012 23:08:17 GMT

I want to log any and all FTP failures when using an FTP consumer. As I
understand I have to,
1. Implement -PollingConsumerPollStrategy
2. set throwExceptionOnConnectFailed=true on the FTP URI. (Is there an
equivalent one for File endpoint?)
3. Also setting, consumer.bridgeErrorHandler=true to handle other exception
happening after Poll finishes.

Now my question is,
1. If I set consumer.bridgeErrorHandler=true (using Camel 2.10)do I still
need to implement PollingConsumerPollStrategy? or will my FTP exception be
automatically handled by the onException clause set on the whole context?
2. The logging is done via a Stateless EJB and I dont want to create one
instance for each FTP consumer rather share one for all FTP consumers.
However I want to customize the Error Message with something specific to the
endpoint URI which caused the exception. I have set a header on the message
after the FTP consumer via 
simple(Long.toString(provider.getId()), Long.class)) but as I understand if
FTP fails there will not even be an exchange that will be created. Hence in
my rollback method in the PollingConsumerPollStrategy implementation I have
no way to get PROVIDER_ID which I need to log. I cannot reverse look up
provider_id using the endpoint URI either.

Is there any other way to achieve this? Pass in an extra parameter to the
rollback method
Thanks in advance,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message