<flow name="entry-flow" doc:name="entry-flow">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8085" path="createOrder" contentType="application/json"
doc:name="HTTP" />
<byte-array-to-string-transformer
doc:name="Byte Array to String" />
<request-reply doc:name="nullRequest-Reply1">
<jms:outbound-endpoint connector-ref="Active_MQ10"
queue="queueOne" doc:name="JMS" />
<jms:inbound-endpoint connector-ref="Active_MQ10"
queue="queueTwo" doc:name="JMS" />
</request-reply>
</flow>
<flow name="jms-flow" doc:name="jms-flow">
<jms:inbound-endpoint connector-ref="Active_MQ10" exchange-pattern="request-response"
queue="queueOne" doc:name="JMS" />
<json:object-to-json-transformer
doc:name="Object to JSON" />
<https:outbound-endpoint exchange-pattern="request-response"
method="POST" address=""
contentType="application/json" doc:name="HTTP">
<set-property propertyName="Authorization"
value="" />
</https:outbound-endpoint>
<byte-array-to-string-transformer doc:name="Byte Array to String" />
</flow>
我正在使用上面的流向第一个jms发送消息然后将消息消息给jms到https请求。但https响应即将到来,但它不会回到jms。
INFO 2014-09-15 17:13:43,895 [ActiveMQ Session Task-1] org.mule.transport.jms.JmsReplyToHandler:回复消息发送到:queue:// queueTwo with correlationID:null
还有一个建议 - &gt;如果我的https请求没有响应或者关闭,那么我在流程中添加了一个东西,然后不消耗来自jms的消息。
答案 0 :(得分:0)
首先,为什么在JMS入站后使用<json:object-to-json-transformer doc:name="Object to JSON" />
?第二件事是我确实从流中发现了一些将JSON数据发送到JMS出站的内容。所以我修改了以下流程: -
<flow name="entry-flow" doc:name="entry-flow">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8085" path="createOrder" contentType="application/json"
doc:name="HTTP" />
<set-payload value="Put Your JSON message here" doc:name="Set Payload"/>
<request-reply doc:name="nullRequest-Reply1">
<jms:outbound-endpoint connector-ref="Active_MQ10"
queue="queueOne" doc:name="JMS" />
<jms:inbound-endpoint connector-ref="Active_MQ10"
queue="queueTwo" doc:name="JMS" />
</request-reply>
</flow>
<flow name="jms-flow" doc:name="jms-flow">
<jms:inbound-endpoint connector-ref="Active_MQ10" exchange-pattern="request-response"
queue="queueOne" doc:name="JMS" />
<https:outbound-endpoint exchange-pattern="request-response"
method="POST" address=""
contentType="application/json" doc:name="HTTP">
<set-property propertyName="Authorization" value="" />
</https:outbound-endpoint>
</flow>
现在您使用<set-payload/>
设置JSON有效负载,如第一个流程中所述。然后您可以在第二个流中使用消息..也可以在JMS入站后删除<json:object-to-json-transformer doc:name="Object to JSON" />
... < / p>