0
<int-jms:channel id="inputChannel" queue-name="WorkRequest"/>
<int-jms:inbound-gateway request-channel="inputChannel" request-destination-name="WorkRequest" extract-request-payload="true" reply-timeout="12000000"/>
<int:chain input-channel="inputChannel">
<int-http:outbound-gateway
url="http://localhost:8080/Validate.php?fileid={foo}"
mapped-request-headers="jms*,reply*,HTTP_REQUEST_HEADERS"
http-method="GET"
reply-timeout="12000000" extract-request-payload="true">
<int-http:uri-variable name="foo" expression="headers.fileid"/>
</int-http:outbound-gateway>
</int:chain>
來自http出站的響應不會路由到臨時JMS隊列。我想知道我應該如何重定向到適當的隊列。我用replyTo使用header-richher,但它不起作用。請幫忙。消費的ActiveMQTextMessage具有需要發佈響應的臨時隊列。請求回覆彈簧集成jms入站和http出站
右鍵只是將' '改爲' '。現在你有這種方式,你有兩個'WorkRequest'消費者(網關通過將消息發送到'inputChannel')把消息寫回同一隊列。 –
2013-04-07 16:55:53
謝謝!有效。但是我現在收到以下錯誤消息。 「無法將[org.springframework.http.ResponseEntity]類型的對象轉換爲JMS消息。支持的消息負載爲:字符串,字節數組,映射,可序列化對象。」我是Spring和Java的新手 –
user2254842
2013-04-07 17:20:11
在出站網關上使用'expected-response-type'屬性。例如,如果您只是獲取文本,請嘗試向出站網關添加'expected-response-type =「java.lang.String」'。 – 2013-04-07 17:31:47