在WSO2 ESB网站http://docs.wso2.org/display/ESB481/RabbitMQ+AMQP+Transport上的示例之后,我正在尝试创建一个代理服务,它将通过HTTP接收消息并将此消息发布到RabbitMQ 3.2.3队列。
我按照教程中的步骤安装了p2-repo.zip并创建了这个代理服务:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SendRabbitProxy"
transports="http"
statistics="enable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
</inSequence>
<endpoint>
<address uri="rabbitmq:/SendRabbitProxy?rabbitmq.server.host.name=localhost&rabbitmq.server.port=5672&rabbitmq.server.user.name=guest&rabbitmq.server.password=guest&rabbitmq.queue.name=myqueue2&rabbitmq.exchange.name=myexchange2"/>
</endpoint>
</target>
<description/>
</proxy>
当我尝试发布消息时,将exchange2 / queue2添加到我的Rabbit服务器中,但引发了以下异常。
有什么我想念的吗?
TID[-1234] [ESB] [2014-02-27 22:51:07,470] ERROR
{org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception
org.apache.axis2.transport.rabbitmq.RabbitMQMessageSender.send(RabbitMQMessageSender.java:100)
org.apache.axis2.transport.rabbitmq.RabbitMQSender.sendOverAMQP(RabbitMQSender.java:85)
org.apache.axis2.transport.rabbitmq.RabbitMQSender.sendMessage(RabbitMQSender.java:72)
org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:482)
org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:59)
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:338)
org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:333)
org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:187)
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411)
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
答案 0 :(得分:0)
您正在使用的ESB版本是什么。如果是&lt; 4.8.0这个问题没有修复。
这是公开的jira - https://wso2.org/jira/browse/ESBJAVA-2449
答案 1 :(得分:0)
这是在WSO2 ESB 4.8.1中解决此问题的解决方法。 似乎没有正确定义Content-Type,在本博客中解释了如何使用Custom Mediator解决它。
问候。