简体   繁体   English

骆驼:RabbitMQ to SOAP:重新排队

[英]Camel: RabbitMQ to SOAP : requeue

I am learning Apache camel and trying to send request from RabbitMQ endpoint to some soap service : 我正在学习Apache骆驼,并尝试从RabbitMQ端点向一些肥皂服务发送请求:

<camelcontext>
route 1 from file:// to rabbitmq queue 
<route id="2">
<from uri="same queue as in route 1"/>
<process "here i am setting header "/>
<pattern>InOut</pattern>
<to uri="soap request"/>
</camelcontext>

What I want is that in case there is any exception at SOAP, exchange should be requeued back to rabbitmq. 我想要的是,如果SOAP发生任何异常,则应将交换重新排队回到Rabbitmq。 I have tried setting header of exchange rabbitmq.REQUEUE to true still no luck, message gets removed even though there is exception. 我尝试将Exchange Rabbitmq.REQUEUE的标头设置为true仍然没有运气,即使有异常,消息也会被删除。 I have tried setting exchange to InOUT too. 我也尝试过将交换设置为InOUT。 Please suggest any pointer. 请提出任何建议。

To catch an exception coming back from calling the SOAP service you could use an onException to catch the fault and then route it to rabbitMQ queue like this: 要捕获从调用SOAP服务返回的异常,可以使用onException捕获故障,然后将其路由到RabbitMQ队列,如下所示:

onException(Fault.class).handled(true)
    .to("rabbitmq:queue-name")

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

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