Hi
Ah you can use the try .. catch to work around this.
http://camel.apache.org/try-catch-finally.html
Mind the documentation above is for camel 2.0, in 1.x you can do try
.. catch only. But it should be possible.
But I am adding a validation option to HL7 so you can do
DataFormat hl7Format = new HL7DataFormat();
hl7Format.setValidate(false);
What I need is just some HL7 data that fails validation for unit test.
On Wed, Jul 29, 2009 at 3:13 PM, Johnny2R<[email protected]> wrote:
>
> 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.
>
>
--
Claus Ibsen
Apache Camel Committer
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus