Tomcat で Camel を使用して、指定されたポートから HL7 データをルーティングし、永続化レイヤーで処理することを検討しています。これを行う方法を理解するのに本当に苦労しています。基本的な構成例として、Spring コードなしで Tomcat を使用しています。Camel HL7の詳細はこちら. URI を変更する方法 (または適切な web.xml および camel-config-xml ファイルを作成する方法) をよく理解していないため、MLLP 接続をリッスンしてから適切な処理クラスにルーティングします。ドキュメントからの uri は次のとおりです。
mina:tcp://localhost:8888?sync=true&codec=#hl7codec
これまでのところ、次のような spring-servlet.xml があります (エラー cvc-complex-type.2.4.c: The matching wildcard is strict, but no Declaration can be found for element 'camel:camelContext'):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:camel="http://activemq.apache.org/camel/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec">
<property name="charset" value="iso-8859-1"/>
</bean>
<bean id="hl7MessageHandler" class="util.HL7MessageHandlerService"/>
<camelContext id="hl7listener" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="mina:tcp://localhost:8888?sync=true&codec=#hl7codec"/>
<to uri="bean:hl7MessageHandler?method=lookupPatient"/>
</route>
</camelContext>
</beans>
そして、次のような web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>HL7 Consumer</display-name>
<!-- location of spring xml files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>CamelServlet</servlet-name>
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CamelServlet</servlet-name>
<url-pattern>/camel/*</url-pattern>
</servlet-mapping>
</web-app>
Camel ルートを構成し、着信メッセージが HL7MessageHandler に確実に渡されるようにする方法がよくわかりません。