Open mpetavy opened 5 years ago
You need to define a HL7Codec for Mina, so that it knows how to unwrap the message. It can be added to the context.xml file:
...
<bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec"/>
The URI is then from("mina2:tcp://localhost:7000?sync=true&codec=#hl7codec")
Thanks for the reply.
But the hl7codec is already recognized, I see in the log the following line:
23:44:54,268 [main] DEBUG - DefaultSingletonBeanRegistry.getSingleton(213) | Creating shared instance of singleton bean 'hl7codec'
So the bean "hl7codec" is already recognized. Setting the codec in the URL does not work since IPF is hiding the "setCodec" method of original Camel class. Due to the documentation [https://oehf.github.io/ipf/ipf-platform-camel-ihe-mllp/mllpCustom.html] the protocol prefix is "mllp". I changed the route definition to:
from("mllp://localhost:7000?sync=true")
but still the same exception like above.
Caused by: org.apache.mina.core.buffer.BufferDataException: dataLength: 189616968
at org.apache.mina.core.buffer.AbstractIoBuffer.prefixedDataAvailable(AbstractIoBuffer.java:2295) ~[mina-core-2.0.19.jar:?]
at org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder.doDecode(ObjectSerializationDecoder.java:93) ~[mina-core-2.0.19.jar:?]
at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:180) ~[mina-core-2.0.19.jar:?]
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:253) ~[mina-core-2.0.19.jar:?]
Any ideas?
I try to run the HL7 tutorial sample with a TCP Mllp endpoint as source. Modified SampleRouteBuilder.groovy
Modified pom.xml: Add dependency for MLLP
When I try to send the provided ipf\tutorials\hl7\src\test\resources\msg-01.hl7 HL7 message to the configured endpoint I get an exception (see below).
What is wrong? Thanks.