You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by costin_sa <ge...@gmail.com> on 2017/01/18 15:24:54 UTC

Camel send receive JMS message

Hi,

I have the following scenario and can't figure out the correct route config
I need. Information is really scarce on Google too.

I need to create a Bytes message, send it to a queue on a remote JMS router
(it is a Solace JMS system), expect a reply on a temporary queue from this
JMS router and then process this reply.
I would like to do this using a temporary queue with Camel. So my route
looks something like:

<route id="solaceSendAndReceive">
    <from uri="bean:createMyMessage">
    <setHeader headerName="someHeader">
      <constant>someHeader</constant>
    </setHeader>
    <to
uri="solaceJms:queue:queueName?jmsMessageType=Bytes&amp;replyToType=Temporary"
pattern="InOut"/>
</route>

Now, what I do not understand is whether after the "to", I will have already
received the response and it is avalable in the exchange object (so I can
process it in the same route after that "to") or I will have to make another
route that would have to start with <from
uri="solaceJms:queue:queueName">... and the reply will arrive there.

Can someone please expain this to me? As I said the info is quite scarce on
the internet.

Thank you in advance.




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-send-receive-JMS-message-tp5792749.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel send receive JMS message

Posted by costin_sa <ge...@gmail.com>.
Thanks for the reply.

But what do you mean by "if it's a proper request-reply"?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-send-receive-JMS-message-tp5792749p5792751.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel send receive JMS message

Posted by souciance <so...@gmail.com>.
If it is a proper request-reply then it response should come after the
"to". You don't need an extra route. Just do a print of the body and
headers after the "to" to see what you get.

On Wed, Jan 18, 2017 at 4:24 PM, costin_sa [via Camel] <
ml-node+s465427n5792749h82@n5.nabble.com> wrote:

> Hi,
>
> I have the following scenario and can't figure out the correct route
> config I need. Information is really scarce on Google too.
>
> I need to create a Bytes message, send it to a queue on a remote JMS
> router (it is a Solace JMS system), expect a reply on a temporary queue
> from this JMS router and then process this reply.
> I would like to do this using a temporary queue with Camel. So my route
> looks something like:
>
> <route id="solaceSendAndReceive">
>     <from uri="bean:createMyMessage">
>     <setHeader headerName="someHeader">
>       <constant>someHeader</constant>
>     </setHeader>
>     <to uri="solaceJms:queue:queueName?jmsMessageType=
> Bytes&amp;replyToType=Temporary" pattern="InOut"/>
> </route>
>
> Now, what I do not understand is whether after the "to", I will have
> already received the response and it is avalable in the exchange object (so
> I can process it in the same route after that "to") or I will have to make
> another route that would have to start with <from uri="solaceJms:queue:queueName">...
> and the reply will arrive there.
>
> Can someone please expain this to me? As I said the info is quite scarce
> on the internet.
>
> Thank you in advance.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-send-receive-JMS-
> message-tp5792749.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-send-receive-JMS-message-tp5792749p5792750.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel send receive JMS message

Posted by Claus Ibsen <cl...@gmail.com>.
Yes it will do a request/reply over JMS when you set pattern to InOut.
Then you can continue afterwards in that route with the reply message
received.



On Wed, Jan 18, 2017 at 4:24 PM, costin_sa <ge...@gmail.com> wrote:
> Hi,
>
> I have the following scenario and can't figure out the correct route config
> I need. Information is really scarce on Google too.
>
> I need to create a Bytes message, send it to a queue on a remote JMS router
> (it is a Solace JMS system), expect a reply on a temporary queue from this
> JMS router and then process this reply.
> I would like to do this using a temporary queue with Camel. So my route
> looks something like:
>
> <route id="solaceSendAndReceive">
>     <from uri="bean:createMyMessage">
>     <setHeader headerName="someHeader">
>       <constant>someHeader</constant>
>     </setHeader>
>     <to
> uri="solaceJms:queue:queueName?jmsMessageType=Bytes&amp;replyToType=Temporary"
> pattern="InOut"/>
> </route>
>
> Now, what I do not understand is whether after the "to", I will have already
> received the response and it is avalable in the exchange object (so I can
> process it in the same route after that "to") or I will have to make another
> route that would have to start with <from
> uri="solaceJms:queue:queueName">... and the reply will arrive there.
>
> Can someone please expain this to me? As I said the info is quite scarce on
> the internet.
>
> Thank you in advance.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-send-receive-JMS-message-tp5792749.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2