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.