camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johnny2R <gra...@jmsd.co.uk>
Subject Re: How to prevent HL7 message validation?
Date Wed, 29 Jul 2009 13:13:38 GMT

Claus, here's the entire method. As I mentioned before, it's derived from
Roger Searjeant's blog entry, which you helped with.

------------------------------------------------------------------------------------------------

public void init() throws Exception {

        ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");

        springCamelContext.addComponent("jms",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));


        springCamelContext.addRoutes(new RouteBuilder() {


            public void configure() {
                 DataFormat hl7Format = new HL7DataFormat();

                Predicate p1 =
header("hl7.msh.messageType").isEqualTo("ORM");
                Predicate p2 =
header("hl7.msh.triggerEvent").isEqualTo("O01");

                Predicate isOrm = PredicateBuilder.and(p1, p2);

               
from("hl7listener").unmarshal(hl7Format).choice().when(isOrm) 
                        .marshal().hl7().to("jms:queue:orderMessage.queue") 
                        .otherwise().beanRef("messageHandler",
"badMessage").end().marshal(hl7Format);


               
from("jms:queue:orderMessage.queue").unmarshal().hl7().beanRef("messageHandler",
"handleORM");

            }
        });
        springCamelContext.start();
    }
-- 
View this message in context: http://www.nabble.com/How-to-prevent-HL7-message-validation--tp24717549p24719021.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message