activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Henderson <>
Subject C++ request-response with temp queue, advice sought
Date Thu, 21 Dec 2006 13:28:24 GMT


I’m trying to get a simple C++ P2P request-response example working using a
fixed queue known to both the client and server to deliver the request and a
temporary queue provided by the client for the server to respond on. I’ve
used the OpenWire amq_examples as a basis for the code, running with
ActiveMQ 4.0.2, OpenWire 0.1.2 on SLES 9. The client is synchronous, it
publishes the request and then blocks (newBlockingMessageConsumer) on
receive() awaiting the arrival of the response. The server is also
synchronous (eventually to be asynchronous) it blocks on receive() to pickup
the request and then publishes the response setting the destination of the
outgoing message to that of the temporary queue supplied in the request,
using replyTo(). The request-response sequence is repeated with a 1 second
delay between each transaction. 

Here’s what I get:

1st iteration
Client: sends request
Server: receives request
Server: responds on temporary queue
Client: receives response

2nd iteration
Client: sends request
Server: receives request
Server: responds on temporary queue

All stops at this point, the client never receives the second response and
both processes sit waiting. This is always the case, I’ve tried stopping and
restarting the broker and carrying out a re-run but no luck.

Note I get the same results if I run the client and server on separate
machines with their own broker as when I run both on the same machine with
one broker.

Now if I use my C++ client to a Java server it works fine, so it looks like
my C++ server is dodgy.

I’ve used the command line tool “browse” to check out the fixed and
temporary queues at the end of the second iteration but find no messages

At the moment we are running with Non Persistent and Non Durable.

Should I be setting the acknowledge mode and if so how do I set it using the
BrokerSession I/F?

I notice that there a couple of reports in this area (AMQ-843 & AMQ-487) but
they do not match exactly what I’m seeing.

I’m new to ActiveMQ so suspect its finger trouble on my part, any help would
be appreciated, thanks.


View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message