tree: 5db726a5d2dcd690a7d9b4b0a9d10f52be404d94 [path history] [tgz]
  1. Listener.cpp
  2. Publisher.cpp
  3. readme.md
assembly/src/release/examples/openwire/cpp/readme.md

Prereqs

These examples use the ActiveMQ-CPP C++ library,

  1. [Download the latest release from the ActiveMQ-CPP website)
  2. Build and Install

Building

This will vary depending on where you installed your libraries and the compiler you are using but on my Ubuntu system, I compiled the examples as follows:

gcc Listener.cpp -o listener -I/usr/local/include/activemq-cpp-3.8.1 -I/usr/include/apr-1.0 -lactivemq-cpp -lstdc++ 
gcc Publisher.cpp -o publisher -I/usr/local/include/activemq-cpp-3.8.1 -I/usr/include/apr-1.0 -lactivemq-cpp -lstdc++ 

Running the Examples

Note: You may need to update set an environment variable so that the activemq-cpp shared libraries can be loaded. For example on my Ubuntu system I had to add the following to my profile:

export LD_LIBRARY_PATH=/usr/local/lib

In one terminal window run:

./listener

In another terminal window run:

./publisher

You can control to which stomp server the examples try to connect to by setting the following environment variables:

  • ACTIVEMQ_HOST
  • ACTIVEMQ_PORT
  • ACTIVEMQ_USER
  • ACTIVEMQ_PASSWORD