简体   繁体   English

骆驼的无限循环:肥皂的消息经纪人

[英]Infinite loop in Camel : message broker to soap

i have defined route in the apache camel which reads queue and then send request to the soap web service and which is then passed to response queue on rabbit mq, problem is that this route becomes infinite route from the rabbitmq queue to soap web service even though it just contains one message. 我在apache骆驼中定义了路由,该路由读取队列,然后将请求发送到soap Web服务,然后将其传递到Rabbit Mq上的响应队列,问题是即使从Rabbitmq队列到soap Web服务,此路由也变成了无限路由它只包含一条消息。 following is the code , 以下是代码,

<route >
            <from uri="rabbitmq://localhost/exchangename?username=user&amp;password=password;autoDelete=false&amp;routingKey=key;queue=nameofqueue" />
            <convertBodyTo type="java.lang.String" />
            <to uri="cxf:bean:helloWorldEndpoint?defaultOperationName=sayHelloWorld" />
            <to uri="rabbitmq://localhost/response exchange?username=name&amp;password=passwd&amp;routingKey=responsekey&amp;autoDelete=false&amp;queue=nameofresponsequeue" />
</route> 

What I am doing wrong ? 我做错了什么?

Edit: So I tried chanding last "to" to the "file" component , it works fine without any problem .So it has comething to do with RabbitMq. 编辑:所以我尝试将最后一个“赞”到“文件”组件,它工作正常,没有任何问题。因此,它与RabbitMq有关。 Also before this route I have another route as following : 同样在这条路线之前,我还有另一条路线,如下所示:

<route id="differentRoute">
            <from uri="file:C:\\file" />            
            <to uri="rabbitmq://localhost/exchangename?username=user&amp;password=password;autoDelete=false&amp;routingKey=key;queue=nameofqueue" />
</route>

so I am reading from file, sending to request queue in first route and then in second route reading from the request queue, sending soap request and then putting response in the response queue. 所以我正在从文件中读取,在第一条路由中发送到请求队列,然后在第二条路由中,从请求队列中读取,发送肥皂请求,然后将响应放入响应队列。

can you add the parameter 您可以添加参数吗

dataFormat=MESSAGE on the cxf endpoint

Since you are sending a plain xml , the dataformat needs to be message , if you are sending POJO can you please post the stacktrace. 由于您要发送的是纯XML格式,因此数据格式必须为message,如果要发送POJO,请发布堆栈跟踪信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM