camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emond Papegaaij <>
Subject Component with asynchronous error reporting
Date Mon, 03 Mar 2008 14:35:32 GMT


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,
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message