You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by vikd <de...@gmail.com> on 2016/05/06 10:01:43 UTC
ActiveMQ REST API - synchronous Request / Response
Hi Team,
how can we achieve synchronous request-response with activemq and REST API
in a single request ?
curl -XPOST -d "body=message"
http://admin:admin@localhost:8161/api/message?destination=queue://TEST&JMSReplyTo=TEST&JMSCorrelationID=10
above request always gives me "Message Sent" response.
currently I need to use another GET request (eg : "curl -XGET " ) on same
queue to get response of Replier, I don't want use another GET request to
get the response.
Please guide me on my below requirement.
1) Requestor(Client side) will post a data on queue (eg TEST ) and after
then will waits on same queue (TEST) till the response complete using
selector (eg selector : JMSCorrelationID = '15').
Note : above activities (post/wait) should be in single request.
eg : curl -XPOST -d "body=message"
http://admin:admin@localhost:8161/api/message?destination=queue://TEST&JMSReplyTo=TEST&JMSCorrelationID=10
2) My Replier class (Server side) listens a message from TEST queue of
ActiveMQ broker.
3) My Replier class (Server side) process the message and then processed
message send back to the Requestor(Client side) on a same queue (TEST )
using getJMSReplyTo() function and setting setJMSCorrelationID(15).
4) Once above steps (till 3rd steps) completed then waiting Requestor(Client
side) should get the response .
Please take a note I have achieved above 2nd and 3rd steps.
I am not sure whether it is feasible or not, however please I need a
guidance on 1st and 4th steps .
Thanks in advance !
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-REST-API-synchronous-Request-Response-tp4711668.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.