You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Toivo Adams <to...@gmail.com> on 2015/05/17 12:40:37 UTC

Request response using JMS and JMSReplyTo

1. External client send request

2. GetJMS* processor receive request, store  JMSReplyTo value 
if (message.getJMSReplyTo() != null) {
       attributes.put(ATTRIBUTE_PREFIX + JMS_REPLY_TO,
message.getJMSReplyTo().toString());}

3. Next processors processes request and create response

4. And finally PutJMS should send response back to channel specified by
JMSReplyTo
But it seems PutJMS is not using JMSReplyTo, instead DESTINATION_NAME
property value is used.

Did I misunderstood something?

Often response is expected to be in JMSReplyTo channel.

Thanks
Toivo




--
View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Request-response-using-JMS-and-JMSReplyTo-tp1557.html
Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.

RE: Request response using JMS and JMSReplyTo

Posted by Mark Payne <ma...@hotmail.com>.
Toivo,

Interesting, I've never thought of having a ReplyTo that is a topic. I suppose it's quite possible, though, as the object returned is a Destination.

Since the JmsFactory is responsible for creating vendor-specific queues/topics as well as mapping a JMS Message to attributes, we could always update it to try to determine the type of the Destination and pull out interesting information from it. And PutJMS could be updated as well to allow an attribute to be used for the Destination Type.

To be honest I've used JMS very little in the last 5 years or so, so I've not got a ton of insight here as to what would be appropriate to pull out of that object. Feel free to supply patches or provide input as to what information should be pulled!

Thanks
-Mark

----------------------------------------
> Date: Mon, 18 May 2015 03:11:03 -0700
> From: toivo.adams@gmail.com
> To: dev@nifi.incubator.apache.org
> Subject: RE: Request response using JMS and JMSReplyTo
>
> Mark,
>
> Excellent!
>
> Only one minor thing which usually should not be a problem.
>
> message.getJMSReplyTo() return Destination type object
> which might contain more information than only queue/topic name.
>
> Usually request sender expect response to to placed in queue
> - so it should work without problem.
>
> But theoretically it can be topic also.
> Or some vendors may but some specific information in Destination
> implementation which will be lost.
>
> Currently FlowFile attributes accept only String type values?!
> So Destination type value cannot be saved in FlowFile attributes?
>
> Thanks
> Toivo
>
>
>
>
> --
> View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Request-response-using-JMS-and-JMSReplyTo-tp1557p1566.html
> Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.
 		 	   		  

RE: Request response using JMS and JMSReplyTo

Posted by Toivo Adams <to...@gmail.com>.
Mark, 

Excellent!

Only one minor thing which usually should not be a problem.

message.getJMSReplyTo() return Destination type object 
which might contain more information than only queue/topic name.

Usually request sender expect response to to placed in queue
- so it should work without problem.

But theoretically it can be topic also.
Or some vendors may but some specific information in Destination
implementation which will be lost.

Currently FlowFile attributes accept only String type values?!
So Destination type value cannot be saved in FlowFile attributes?

Thanks
Toivo




--
View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Request-response-using-JMS-and-JMSReplyTo-tp1557p1566.html
Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.

RE: Request response using JMS and JMSReplyTo

Posted by Mark Payne <ma...@hotmail.com>.
Toivo,

You're absolution right - this is very much an oversight, I think.

Typically, when I've used JMS processors I've been using GetJMS or PutJMS, but I've not used GetJMS -> (something else) -> PutJMS.

PutJMS really should allow the Expression Language to be used for the Destination. This would allow you to use the value '${jms.JMSReplyTo}' but unfortunately the property doesn't currently support the Expression Language. I have created a ticket (NIFI-610) to address this.

Thanks
-Mark

----------------------------------------
> Date: Sun, 17 May 2015 03:40:37 -0700
> From: toivo.adams@gmail.com
> To: dev@nifi.incubator.apache.org
> Subject: Request response using JMS and JMSReplyTo
>
> 1. External client send request
>
> 2. GetJMS* processor receive request, store JMSReplyTo value
> if (message.getJMSReplyTo() != null) {
> attributes.put(ATTRIBUTE_PREFIX + JMS_REPLY_TO,
> message.getJMSReplyTo().toString());}
>
> 3. Next processors processes request and create response
>
> 4. And finally PutJMS should send response back to channel specified by
> JMSReplyTo
> But it seems PutJMS is not using JMSReplyTo, instead DESTINATION_NAME
> property value is used.
>
> Did I misunderstood something?
>
> Often response is expected to be in JMSReplyTo channel.
>
> Thanks
> Toivo
>
>
>
>
> --
> View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Request-response-using-JMS-and-JMSReplyTo-tp1557.html
> Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.