camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marek2009 <Marek.Vacla...@icw.de>
Subject Re: "Trash bin" endpoint?
Date Tue, 28 Jul 2009 21:42:00 GMT

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.


Mime
View raw message