You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marek2009 <Ma...@icw.de> on 2009/07/28 23:42:00 UTC
Re: "Trash bin" endpoint?
Hi folks,
many thanks for the tips. To implement a "trashbin sink" in my Camel 1.6
route I tried out a few constructs, among others a null file, a direct
endpoint and a SEDA endpoint.
At last, the following (Groovy) code yielded a behaviour I was satisfied
with - no observed side effects, no exceptions, no warnings.
.choice()
.when{ ...}
...
.when{ ...}
.to('direct:custom-channel-purger')
builder
.from('direct:custom-channel-purger')
.process{it.in.body = ''}
.filter{false}
In my particular route endpoints expecting a response (HTTP, MLLP) protested
when a message was discarded. The HTTP server endpoint (Jetty) complained:
"org.apache.camel.NoTypeConversionAvailableException: No type converter
available to convert from type: class org.apache.camel.impl.DefaultMessage
to the required type: java.io.InputStream..." I was also getting warnings
from my HL7 MLLP (mina) endpoint:
"org.apache.mina.filter.codec.ProtocolEncoderException".
Thus I added an empty string body to be used as a response.
--
View this message in context: http://www.nabble.com/%22Trash-bin%22-endpoint--tp24227620p24708404.html
Sent from the Camel - Users mailing list archive at Nabble.com.