我尝试使用WSO2 ESB 4.8.1处理以下情况。
ActiveMQ队列< --- proxy ----> WSDL端点(Bizagi)
对于外部情况(例如,外部网络故障),远程端点将停止服务,并由ESB声明为null。从队列中侦听消息时,代理尝试使用发送中介到端点,并显示以下堆栈跟踪。
2017-01-23 11:17:15,135 [-] [http-nio-9443-exec-14] **WARN HTTPEndpointFactory Could not read the WSDL endpoint http://IP-Host-Hidden/Procesos/webservices/WorkflowEngineSOA.asmx?wsdl
java.net.NoRouteToHostException: No route to host**
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
at sun.net.www.http.HttpClient.New(HttpClient.java:308)
at sun.net.www.http.HttpClient.New(HttpClient.java:326)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
at org.apache.synapse.config.SynapseConfigUtils.getOMElementFromURL(SynapseConfigUtils.java:312)
at org.apache.synapse.config.xml.endpoints.WSDLEndpointFactory.createEndpoint(WSDLEndpointFactory.java:132)
at org.apache.synapse.config.xml.endpoints.EndpointFactory.createEndpointWithName(EndpointFactory.java:143)
at org.apache.synapse.config.xml.endpoints.EndpointFactory.getEndpointFromElement(EndpointFactory.java:80)
at org.wso2.carbon.endpoint.ui.endpoints.wsdl.WsdlEndpoint.build(WsdlEndpoint.java:404)
2017-01-23 11:17:16,138 [-] [demo_in_jms-Worker-2] ERROR JMSMessageReceiver Unknown error processing message java.lang.NullPointerException
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.isTransportSwitching(Axis2SynapseEnvironment.java:571)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:335)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:333)
at org.apache.synapse.endpoints.WSDLEndpoint.send(WSDLEndpoint.java:69)
at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:54)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:328)
at org.apache.axis2.transport.jms.JMSMessageReceiver.processThoughEngine(JMSMessageReceiver.java:200)
at org.apache.axis2.transport.jms.JMSMessageReceiver.onMessage(JMSMessageReceiver.java:122)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.handleMessage(ServiceTaskManager.java:556)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:449)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
检查Github的WSDLEndpointFactory类,不是在中介层上抛出一个可擦除的异常,只是基于Java网络库的警告,但这在JMSMessageReceiver上引发了NPE,并且需要处理强制错误和代理采用&#34;故障序列&#34;路径。
我非常感谢什么样的解决方案适用于实现这种情况的序列。
答案 0 :(得分:0)
正如您所指出的,如果不从WSDLEndpointFactory类[1]中抛出异常,则无法通过更改配置将消息定向到故障序列。
如果您没有任何特殊情况可以使用WSDL端点,则可以在代理服务配置中使用地址端点而不是WSDL端点来克服此问题。