Hi
I do not use onComplete to send ACK or NACK.
I use onComplete().onCompleteOnly() to log Ok and onComplete().OnFailed() to
log KO
in my main route, if I do not catch the error
the NACK is not sent to the socket and onComplete() log KO
the If i catch the error, the NACK is sent to the socket and onComplete log
OK
the question is How to send the NACK in the main road and pass the
onComplete().onFailed () to log KO (not Ok)
onComplete().onCompleteOnly().log("OK");
onComplete().onFailed().log("KO")
// 1) without catch the transform bean raise exception.
// the route finsh on fail
// an other exception is raised "could not write Myexception in socket
// the onComplete().onFailed is activated and log KO
From("mina:tcp:.....")
.bean("transform") // raise an exception
.inOnly("jms:out");
// 2) with catch the transform bean raise exception.
// the exception is catched
// the NACK is sent to socket
// the route finish without error
// the onComplete().ononComplete is activated ans log KO
From("mina:tcp:.....")
.dotray()
.bean("transform") // raise an exception
.inOnly("jms:out")
.doCatch(...)
.bean(SetBodyAsNACK) // define content of Nack
.bean(RemoveErrorOnEchange) // if the error is not removed mine try to send
the exception tout the socket
.end()
I want
// 2) with catch the transform bean raise exception.
// the exception is catched
// the NACK is sent to socket
// the route finish
// the onComplete().onFailed is activated and log KO
A + JYT
--
View this message in context:
http://camel.465427.n5.nabble.com/Mina-TCP-MllpHl7-NACK-and-onComplete-OnFailed-howto-tp5689190p5692984.html
Sent from the Camel - Users mailing list archive at Nabble.com.