我正在尝试聚合 2 个服务的响应,这两个响应都是 HL7 格式。但聚合后,第一条消息进入输出。
请帮我解决这个问题。
请找到 HL7 响应和代理服务。
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><Prescription xmlns="http://hl7.org/fhir">
<identifier>
<id value="t001"/>
</identifier>
<status value="active"/>
<patient>
<type value="Patient"/>
<url value="test"/>
</patient>
<prescriber>
<type value="Provider"/>
<url value="Dr.Mathews"/>
</prescriber>
<medicine>
<identification>
<text value="Zintac"/>
</identification>
</medicine>
</Prescription></soapenv:Envelope></soapenv:Body></soapenv:Envelope>
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><Prescription xmlns="http://hl7.org/fhir">
<identifier>
<id value="t001"/>
</identifier>
<status value="active"/>
<patient>
<type value="Patient"/>
<url value="test"/>
</patient>
<prescriber>
<type value="Provider"/>
<url value="Dr.John"/>
</prescriber>
<medicine>
<identification>
<text value="tantac"/>
</identification>
</medicine>
</Prescription></soapenv:Envelope></soapenv:Body></soapenv:Envelope>
代理服务:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="hospital" transports="https,http,jms,local" statistics="enable" trace="enable" startOnLoad="true">
<target>
<inSequence>
<property name="ContentType" value="text/xml" scope="default"/>
<class name="com.wipro.iSoVA.HL7Converter"/>
<clone sequential="true">
<target to="http://localhost:8280/services/lab1/">
<endpoint name="lab1">
<address uri="http://localhost:8280/services/lab1/"/>
</endpoint>
</target>
<target to="http://localhost:8280/services/lab2/">
<endpoint name="lab2">
<address uri="http://localhost:8280/services/lab2/"/>
</endpoint>
</target>
</clone>
</inSequence>
<outSequence>
<aggregate>
<completeCondition>
<messageCount min="2"/>
</completeCondition>
<onComplete xmlns:f="http://hl7.org/fhir" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" expression="//f:Prescription">
<log level="full"/>
<send>
<endpoint>
<address uri="jms:/finalreport?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616"/>
</endpoint>
</send>
</onComplete>
</aggregate>
</outSequence>
<faultSequence/>
</target>
<parameter name="transport.jms.ContentType">
<rules xmlns:f="http://hl7.org/fhir" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<description></description>
</proxy>
在日志中,我可以看到这两条消息都是丰富的日志:
Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelo
pe xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><Pres
cription xmlns="http://hl7.org/fhir">
<identifier>
<id value="t001"/>
</identifier>
<status value="active"/>
<patient>
<type value="Patient"/>
<url value="test"/>
</patient>
<prescriber>
<type value="Provider"/>
<url value="Dr.Mathews"/>
</prescriber>
<medicine>
<identification>
<text value="Zintac"/>
</identification>
</medicine>
</Prescription><Prescription xmlns="http://hl7.org/fhir">
<identifier>
<id value="t001"/>
</identifier>
<status value="active"/>
<patient>
<type value="Patient"/>
<url value="test"/>
</patient>
<prescriber>
<type value="Provider"/>
<url value="Dr.John"/>
</prescriber>
<medicine>
<identification>
<text value="tantac"/>
</identification>
</medicine>
</Prescription></soapenv:Body></soapenv:Envelope>
[2013-05-27 11:59:46,926] WARN - TimeoutHandler Expiring message ID : urn:uuid:
7ef92f4b-7637-4ea7-a832-a7bc66a71d38; dropping message after global timeout of :
6 seconds
提前致谢......