Hi,

I have created below camel-context.xml file .Camel context and route is
started without any errors. when I send Hl7 message from java client nothing
happens- i dont see any logs, exception nor mesaage in java code which is
listening on 9020. Can someone please help on how to debug this

java client code :

     private static final char END_OF_BLOCK= '\u001c';
     private static final char START_OF_BLOCK= '\u000b';
     private static final char CARRIAGE_RETURN= 13;

     public static void main(String[] args) throws IOException{
      
     Socket socket = new Socket("localhost", 8020);
     System.out.println("Conneted to Server");

     StringBuffer testHL7ADTMessage = new StringBuffer();

     testHL7ADTMessage
         .append(START_OF_BLOCK)
.append("MSH|^~\\&||||namespace ID^universal
ID^|20110607^||ADT^A04|#ControlNumber#|D^|2.3.1||AL|AL|||8859/1||\"\"|Conformanc")
     .append(CARRIAGE_RETURN)
     .append("EVN||20110607^|20110607^|01|||namespace ID^universal ID^")
     .append(CARRIAGE_RETURN)
.append(END_OF_BLOCK);
OutputStream out = socket.getOutputStream();
     out.write(testHL7ADTMessage.toString().getBytes());



logs:
Bound to server address: localhost/127.0.0.1:8020 using acceptor: (nio
socket acceptor: localAddress(es): [/127.0.0.1:8020], managedSessionCount:
0)
Route: route1 started and consuming from:
Endpoint[mina2://tcp://localhost:8020?codec=%23hl7codec&sync=false]
Total 1 routes, of which 1 is started.
Apache Camel 2.13.2 (CamelContext: camel-1) started in 0.945 seconds




camel-context.xml file:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>           
        <bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec" 
>
                <property name="charset" value="iso-8859-1"/>
    </bean>
  <camel:camelContext xmlns="http://camel.apache.org/schema/spring";>
         <camel:route>   
        <camel:from
uri="mina2:tcp://localhost:8020?sync=false&amp;codec=#hl7codec"/>
         <camel:log message="message received"/>
         <camel:to
uri="mina2:tcp://localhost:9020?sync=false&amp;codec=#hl7codec"/>        
         </camel:route>
  </camel:camelContext>
</beans>

Thanks
Sandeep



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-route-with-mina2-and-HL7codec-not-working-tp5755981.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to