0
votes
<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>

I am using above flow to send message to first jms then consume message to jms to https request. but https response is coming but its not back to jms.

INFO 2014-09-15 17:13:43,895 [ActiveMQ Session Task-1] org.mule.transport.jms.JmsReplyToHandler: Reply Message sent to: queue://queueTwo with correlationID:null

one more advise-> I have add one more thing in flow if my https request is not responding or down then do not consume message from jms.

1

1 Answers

0
votes

First of all why are you using <json:object-to-json-transformer doc:name="Object to JSON" /> after JMS inbound ? Second thing is that I did found anything from the flow that will send a JSON data to JMS outbound .. So I modified the flow in the following :-

<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>

Now you set the JSON payload using <set-payload/> as descrived in the first flow .. Then you can consume the message in the second flow .. also remove the <json:object-to-json-transformer doc:name="Object to JSON" /> after JMS inbound ...