-1

I try to run an example from http://activemq.apache.org/cms/cms-api-overview.html, so pasted the main.cpp code to my qt creator added apr and activemq libraries and compiled with success, but nothing happened after. I mean the console printed:

============================================
Starting the example
--------------------------------------------

and nothing else. I noticed by simply printing couts that

std::cout <<"START" <<std::endl;
connection->start();
std::cout <<"AFTER START" <<std::endl; 

console didn't print the second cout so it must be a problem with connection->start(); Could u help me?

Starspire
  • 272
  • 3
  • 15
  • This seems like an old question but still active maybe? Anyway, struggling with the same problem and found that prior to the start() the connectionFactory is creating a connection, though my problem was solved by setting the username and password prior to start() call. I don't know if this is a flaw/bug or simply my misstake. I assume you have started and created a user in a the broker. Also see [Kevin Boone's article](http://kevinboone.net/cmstest.html) that helped med get going. At least up till the point where I am today ;) – Anders S Feb 18 '16 at 15:35

1 Answers1

0

The problem would be that you are either not running an ActiveMQ broker instance or not changing the example code to correctly call out the hostname / ipaddress of your broker. The default is 127.0.0.1 so if your broker is not on the local machine then of course that won't work. The client hangs because it also uses the failover transport by default so it is waiting for a broker to come up.

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