You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Emond Papegaaij <em...@group2000.eu> on 2008/03/03 15:35:32 UTC

Component with asynchronous error reporting

Hello,

I'm trying to develop a Camel component for a proprietary protocol. The
Camel endpoint serves as a client for this protocol, with a standing TCP/IP
connection, which can send commands to a server. The server replies with a
response. The server can also send notifications back to the client over the
connection. I've used a Producer for sending the commands and a Consumer for
receiving responses and notifications.

When everything goes well, this is working fine. However, the protocol
includes some timeouts and can detect problems with the body of the message.
These errors are reported back to the sender of the command asynchronously.
I am able to send these error messages to the Consumer, but that would
require the Processor at the Consumer side to detect if the message is an
error or not. It is not possible for the Producer to block until the outcome
is clear, because the timeouts can be quite lengthy (several hours).

What would be a clean way of handling such errors? Right now, I've added
'setException' on the Consumer side, which seems to cause the
'from("my:protocol:url")' call to abort with an exception, which I can
handle at the global RouterBuilder level. Is this the preferred way of
handling errors?

Best regards,
Emond
-- 
View this message in context: http://www.nabble.com/Component-with-asynchronous-error-reporting-tp15805117s22882p15805117.html
Sent from the Camel - Users mailing list archive at Nabble.com.