2017-05-31 101 views
0

是否可以使用駱駝路由發送活動mq中的wsdl請求正文。如果是,我可以在下面實現的是我的示例代碼,其中im試圖發送隊列中的wsdl請求正文,但沒有發生。如何使用駱駝路由在activemq中發送wsdl請求正文

<route id="report"> 
      <from id="_from2" uri="direct:reportIncident"/> 
      <to id="_to3" uri="activemq:queue:in.incident.report"/> 
      <process id="_process1" ref="reportIncidentProcessor"/> 
      <to id="_to1" uri="log:output"/> 
     </route> 

我有例外下面我fuse.log文件

org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 20000 millis due reply message with correlationID: Camel-ID-NISB-TEC-C3880-54427-1496206891706-5-5 not received on destination: temp-queue://ID:NISB-TEC-C3880-54424-1496206882676-7:1:1. Exchange[ID-TEC-1496206891706-5-4] 
    at org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:153)[246:org.apache.camel.camel-jms:2.17.0.redhat-630077] 
    at org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:62)[246:org.apache.camel.camel-jms:2.17.0.redhat-630077] 
+0

該消息發送給AMQ,但在另一端沒有人使用它併發送回復機智欣20秒。如果你不想或者不需要通信是請求 - 回覆,那麼你需要相應地設置交換模式或者[配置終端](http://camel.apache.org/jms.html)來達到這個效果。 – Ralf

回答

1

Web服務調用默認情況下INOUT,當你發送給它的ActiveMQ傳達了相同的風格,因此期望回覆你不會得到的消息,因此你會看到這個異常。

所以,如果你想發送INONLY(發射後不管)消息ActiveMQ的,那麼你需要指定

<to id="_to3" uri="activemq:queue:in.incident.report"/> 

應該

<to id="_to3" pattern="InOnly" uri="activemq:queue:in.incident.report"/> 

多見於: - http://camel.apache.org/event-message.html - http://camel.apache.org/request-reply.html

+0

非常感謝@Claus的工作。但是我可以在駱駝路由中獲得wsdl請求主體/參數的哪些人將它們發送到隊列中。獲取此異常導致:javax.jms.JMSException:無法從內容構建主體。不可用於經紀商的可序列化類。原因:java.lang.ClassNotFoundException:禁止的類org.apache.cxf.message.MessageContentsList!這個類不被信任被序列化爲ObjectMessage有效載荷。請查看http://activemq.apache.org/objectmessage.html以獲取有關如何配置可信類的更多信息。 –

+0

您需要將消息轉換爲可以通過JMS發送的類型,例如String或byte []發送 - 請參閱'convertBodyTo' –