0

I started to work with Activemq-cpp and used the asychronous client that is available as example. But now I want to implement a request-response, i.e. the producer starts sending a message to the consumer and waits for the response. The consumer gets the message, changes it and sends back to the producer. The consumer has a receive option, but I have no idea how to configure both for request-response, especially the producer.

I appriciate any help. Thx in advance.

Community
  • 1
  • 1
LeBro
  • 13
  • 5

1 Answers1

0

The CMS client is a porting of JMS to C++ and as such the examples that explain how to do JMS Request / Response are easy to port to the C++ client.

The basic structure is that on the request side the client must create a producer to send the request and a consumer to process the response. The consumer should be created and be listening on the target response destination prior to sending the request. On the responder side a consumer is created that reads from the request Queue and does its work and when done it creates a producer that sends a response to the destination specified in the ReplyTo property of the incoming request.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42