<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<context:component-scan base-package="com.nantian.ecm.server" />
<camel:camelContext id="camel">
<camel:package>com.nantian.ecm.server</camel:package>
<!-- camel:jmxAgent id="agent" createConnector="true" connectorPort="1099" /-->
<camel:endpoint id="ReqForMetadata" uri="jms:queue:LOCAL.REQ.META" />
<camel:endpoint id="ReqForObject" uri="jms:queue:LOCAL.REQ.OBJ" />
<camel:endpoint id="ReqForSegment" uri="jms:queue:LOCAL.REQ.SEG" />
<camel:endpoint id="ResForObject" uri="jms:queue:LOCAL.RES.OBJ" />
<camel:endpoint id="ResForSegment" uri="jms:queue:LOCAL.RES.SEG" />
<camel:endpoint id="ReqBasedOnHttp" uri="jetty:http://PC-Kevin:9082/ecm/EcmService" />
<!-- MQ based components navigation start here -->
<camel:route id="metaDataHandler">
<camel:from ref="ReqForMetadata" />
<camel:to uri="metaMessageReader" />
<camel:choice>
<camel:when id="queryDocByDocId">
<camel:simple>${in.header.operation}=="queryDocByDocId"</camel:simple>
<camel:to uri="queryDocByDocId" />
<camel:to uri="mqFileSender" />
</camel:when>
<camel:when id="queryDocVersionsByDocId">
<camel:simple>${in.header.operation}=="queryDocVersionsByDocId"</camel:simple>
<camel:to uri="queryDocVersionsByDocId" />
</camel:when>
</camel:choice>
<camel:to uri="generalResponseOrgnizer" />
</camel:route>
<camel:route id="objectDataHandler">
<camel:from ref="ReqForObject" />
<camel:to uri="objectMessageReader" />
<camel:choice>
<camel:when>
<camel:simple>${header.operation} == 'addDocuments'</camel:simple>
<camel:to uri="addDocuments" />
</camel:when>
<camel:when>
<camel:simple>${header.operation} == 'updateDocuments'</camel:simple>
<camel:to uri="updateDocuments" />
</camel:when>
</camel:choice>
</camel:route>
<camel:route id="segmentDataHandler">
<camel:from ref="ReqForSegment" />
<camel:to uri="segmentMessageReader" />
</camel:route>
<!-- MQ based components navigation end here -->
<!-- Http based components navigation start here -->
<camel:route>
<camel:from ref="ReqBasedOnHttp" />
<camel:to uri="httpMessageReader" />
<camel:choice>
<camel:when>
<camel:simple>${header.operation} == 'queryDocByDocId'</camel:simple>
<camel:to uri="queryDocByDocId" />
<camel:to uri="generalResponseOrgnizer" />
</camel:when>
<camel:when>
<camel:simple>${header.operation} == 'queryDocVersionsByDocId'</camel:simple>
<camel:to uri="queryDocVersionsByDocId" />
<camel:to uri="generalResponseOrgnizer" />
</camel:when>
<camel:when>
<camel:simple>${header.operation} == 'addDocuments'</camel:simple>
<camel:to uri="addDocuments" />
<camel:to uri="generalResponseOrgnizer" />
</camel:when>
<camel:when>
<camel:simple>${header.operation} == 'updateDocuments'</camel:simple>
<camel:to uri="updateDocuments" />
<camel:to uri="generalResponseOrgnizer" />
</camel:when>
</camel:choice>
</camel:route>
<!-- Http based components navigation end here -->
</camel:camelContext>
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="com.ibm.mq.jms.MQConnectionFactory">
<property name="queueManager" value="TestQueueCtrl" />
<property name="hostName" value="localhost"></property>
<property name="port" value="1414"></property>
<property name="CCSID" value="819"></property>
</bean>
</property>
</bean>
<aop:aspectj-autoproxy />
</beans>