WSO2服务链 - 代理服务

时间:2013-05-13 12:05:01

标签: wso2 wso2esb

我有一个用例,其中请求被发送到代理A.然后它被克隆到两个不同的代理,即代理B&代理C.

代理B&必须在代理A的后序中捕获代理C.

这个逻辑会起作用吗?因为我收到了这个错误:

[2013-05-13 17:15:08,304] ERROR - ClientUtils The system cannot infer the transp
ort information from the /services/LIS/ URL.
[2013-05-13 17:15:08,304] ERROR - Axis2Sender Unexpected error during sending me
ssage out
org.apache.axis2.AxisFault: The system cannot infer the transport information fr
om the /services/LIS/ URL.
        at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtil
s.java:81)
        at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationCl
ient.executeImpl(DynamicAxisOperation.java:115)
        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:
149)
        at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2Flexib
leMEPClient.java:456)
        at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2Synap
seEnvironment.java:316)
        at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediato
r.java:92)
        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:71)
        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMe
diator.java:114)
        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(Pro
xyServiceMessageReceiver.java:154)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
        at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEn
closingRESTHandler(ServerWorker.java:367)
        at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclo
singRequest(ServerWorker.java:408)
        at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.j
ava:219)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(Native
WorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603)
        at java.lang.Thread.run(Thread.java:722)
[2013-05-13 17:16:08,228]  WARN - TargetHandler Connection time out while in sta
te: REQUEST_DONE
[2013-05-13 17:16:08,229]  WARN - SourceHandler Connection time out after reques
t is read: 127.0.0.1:53170->127.0.0.1:8280
[2013-05-13 17:16:08,235]  WARN - EndpointContext Endpoint : LIS will be marked
SUSPENDED as it failed
[2013-05-13 17:16:08,231]  WARN - SourceHandler Connection time out after reques
t is read: 127.0.0.1:53169->127.0.0.1:8280
[2013-05-13 17:16:08,237]  WARN - EndpointContext Suspending endpoint : LIS - cu
rrent suspend duration is : 30000ms - Next retry after : Mon May 13 17:16:38 IST
 2013
[2013-05-13 17:16:08,247]  WARN - TargetHandler Connection closed by target host
 before receiving the request
[2013-05-13 17:16:08,250]  WARN - EndpointContext Endpoint : RIS will be marked
SUSPENDED as it failed
[2013-05-13 17:16:08,253]  WARN - EndpointContext Suspending endpoint : RIS - cu
rrent suspend duration is : 30000ms - Next retry after : Mon May 13 17:16:38 IST

我的代理:

<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.test.custommediator"/>
         <clone>
            <target>
               <endpoint name="LIS">
                  <address uri="http://localhost:8280/services/LIS/"/>
               </endpoint>
            </target>
            <target>
               <endpoint name="RIS">
                  <address uri="http://localhost:8280/services/RIS/"/>
               </endpoint>
            </target>
         </clone>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <log separator="Entering Aggregator"/>
         <aggregate>
            <completeCondition>
               <messageCount min="2"/>
            </completeCondition>
            <onComplete xmlns:m1="http://services.samples/xsd" xmlns:m0="http://services.samples" expression="//m0:return">
               <send>
                  <endpoint>
                     <address uri="jms:/REPORT?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>
   <publishWSDL uri="http://localhost:8280/services/LIS?wsdl"/>
   <parameter name="transport.jms.ContentType">
      <rules>                                                                                                                                                                                                               
         <jmsProperty>contentType</jmsProperty>                                                                                                                                                                                                               
         <default>application/xml</default>                                                                                                                                          
      </rules>
   </parameter>
   <description></description>
</proxy>

对我有什么想法?

此致 大师@gnanagurus

2 个答案:

答案 0 :(得分:2)

你的逻辑是正确的。 如果此代理从jms队列中选择消息,请在克隆介体之前的inSequence中设置以下属性,然后重试。

<property name="messageType" value="text/xml" scope="axis2"/>

答案 1 :(得分:0)

你的逻辑和代理conf是对的..问题是系统无法识别端点.. 您的服务网址是对的吗? 你能这样做吗? (删除末尾的反斜杠)

http://localhost:8280/services/LIS