You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the build generated with cmake instructions, the program exits with code 0. On using make instructions to build the library, the same code listens for incoming messages from rabbitmq server as expected.
I used the following cmake instructions to build the library:
Also, I used the following make instructions to build the library:
git clone [email protected]:CopernicaMarketingSoftware/AMQP-CPP.git
cd AMQP-CPP
make
sudo make install
Expected behavior and actual behavior Expected behaviour: Program should listen for incoming messages from rabbitmq. Actual behaviour: Program exits with code 0. I tried adding break points in the lambda functions but same result. No error message on passing invalid credentials or host either.
Main file
intmain() {
// access to the boost asio handler// note: we suggest use of 2 threads - normally one is fin (we are simply// demonstrating thread safety).
boost::asio::io_service service(4);
// handler for libev
AMQP::LibBoostAsioHandler handler(service);
// make a connection
AMQP::TcpConnection connection(&handler,
AMQP::Address("amqp://localhost/"));
// we need a channel too
AMQP::TcpChannel channel(&connection);
// On error
channel.declareQueue(config::RABBITMQ_QUEUE_NAME)
.onError([&handler](constchar *message) {
std::cout << "Channel error: " << message << std::endl;
// handler.st
});
// Consume handler
channel.consume(config::RABBITMQ_QUEUE_NAME, AMQP::noack)
.onReceived(
[](const AMQP ::Message &msg, uint64_t tag, bool redelivered) {
std::cout << "Received: " << msg.body() << std::endl;
});
// run the handler// at the moment, one will need SIGINT to stop. In time, should add signal// handling through boost API.return service.run();
}
I tried example code for libev as well and had the same result with cmake build. I have compiled the new library using make for now, but I can check and post results later along with onError method for connection.
Describe the bug
When using the build generated with cmake instructions, the program exits with code 0. On using make instructions to build the library, the same code listens for incoming messages from rabbitmq server as expected.
I used the following cmake instructions to build the library:
Also, I used the following make instructions to build the library:
Expected behavior and actual behavior
Expected behaviour: Program should listen for incoming messages from rabbitmq.
Actual behaviour: Program exits with code 0. I tried adding break points in the lambda functions but same result. No error message on passing invalid credentials or host either.
Main file
CmakeLists.txt
The text was updated successfully, but these errors were encountered: