Sure, here is the route:

        from("servlet:///data-in").convertBodyTo(String.class)
        .to("validator:schema-file.xsd")
        .inOnly("jms:queue:inbound")
        .choice()
        .when().xpath("/a:data/a:dataLog1", ns)
                .unmarshal(jaxbDf)
                .beanRef("dataLog1Processor", "process")
                .marshal(jaxbDf)
                .to("jms:queue:processed")
        .when().xpath("/a:data/a:dataLog2", ns)
                .unmarshal(jaxbDf)
                .beanRef("dataLog2Processor", "process")
                .marshal(jaxbDf)
                .to("jms:queue:" + processedQueue)
        .otherwise().to("mock:invalid");
        
       from("jms:queue:processed")
       .choice()
       .when(header("errorsFound").isEqualTo(true))
                .to("jms:queue:errors")
       .otherwise().to("mock:finished");




willem.jiang wrote:
> 
> Hi,
> 
> Can we have a look at your camel route?
> Which version of camel are your using?
> 
> You issue relates to the ErrorHandler[1], you may need to go through the 
>   wiki document for it.
> 
> [1]http://camel.apache.org/error-handler.html
> 
> Willem
> 
> jfaath wrote:
>> I have a camel application that's using a remote ActiveMQ broker
>> instance. 
>> Messages come in to the application via HTTP and are sent to a "inbound"
>> queue using "inOnly".  Messages are then processed and sent to a
>> "processed"
>> queue.  Finally, if an error occurred during processing, those messages
>> are
>> sent to an "errors" queue.
>> 
>> So, ideally at the end, there should only be messages either in the
>> "processed" queue or the "errors" queue.  Actually, I don't really care
>> if
>> they end up in the "processed" queue, but I definitely need to see the
>> messages in the "errors" queue.
>> 
>> However, what ends up happening is, full messages stay in the "inbound"
>> queue under "pending messages", messages are processed as expected but
>> nothing ends up in the "processed" queue and while messages resulting in
>> errors do end up in the "errors" queue, the message body is gone.
>> 
>> I'm using the ActiveMQ web console to inspect the queues.  The
>> "processed"
>> queue is the only one that has a consumer attached to it (which explains
>> why
>> it ends up with no messages).  Is this expected behavior? How can I have
>> control over what is happening with messages in these queues using camel
>> routes?  Really what I most need fixed is to not lose the body of the
>> message in the error queue.
>> 
>> -JF
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Remote-broker-message-behavior-tp28287920p28331966.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Reply via email to