camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Mina:TCP MllpHl7 NACK and onComplete().OnFailed () howto ?
Date Tue, 08 May 2012 07:38:57 GMT

As mentioned on the on completion web page

Camel spins of a new and separate thread to process the on completion.
So its *extra* work that runs on the side of the original route. So
you should NOT use that to send back a ACK or NACK. That should be
computed and handled in your original route.

The on completion, can be used to trigger async log messages to be
send to a log central database, or fire out an email, or send a alert
to a snmp server, or something else.

We may wanna emphasize that better on the documentation page in the future.

On Sun, May 6, 2012 at 2:35 PM, sekaijin <> wrote:
> Hi.
> how to manage the TCP acknowledgment with Camel.
> I have a route that receives via mina:TCP for HL7 message (MllpHl7Codec)
> when the route ends, the contents of the body is returned Socket as ACK.
> the route ends in the onComplete().onCompleteOnly()
> if an error occurs, whithout exception treatment, camel send the exception
> in the socket and causes an error.
> the route ends in the onComplete().onFailed()
> if I add a onException to catch the error. I can place a NACK in the body
> and clear the error
> the NACK is then sent into the socket but the route ends in the
> onComplete().onCompleteOnly().
> This makes sense because I have removed the error of the exchange.
> How to Return a NACK and finish the route in the onComplete().OnFailed()?
> Thank you.
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message