diff --git a/main.cpp b/main.cpp index c0fe30c..bf118f2 100644 --- a/main.cpp +++ b/main.cpp @@ -12,13 +12,14 @@ int main() ConnectionHandler handler(loop); // make a connection - AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://proxmox:proxmox@mq.pseudot.org:5671")); + + AMQP::TcpConnection connection(&handler, AMQP::Address("amqps://proxmox:proxmox@mq.pseudot.org:5671/")); // we need a channel too AMQP::TcpChannel channel(&connection); // create a temporary queue - channel.declareQueue(AMQP::exclusive).onSuccess([&connection](const std::string &name, uint32_t messagecount, uint32_t consumercount) { + channel.declareQueue("ciao-bella-cpp",AMQP::durable).onSuccess([&connection](const std::string &name, uint32_t messagecount, uint32_t consumercount) { // report the name of the temporary queue std::cout << "declared queue " << name << std::endl; diff --git a/src/rmq/ConnectionHandler.cpp b/src/rmq/ConnectionHandler.cpp index 21ec911..d292adf 100644 --- a/src/rmq/ConnectionHandler.cpp +++ b/src/rmq/ConnectionHandler.cpp @@ -12,13 +12,7 @@ std::cout << "AMQP READY\n"; } - - void ConnectionHandler::onError( - AMQP::TcpConnection *connection, - const char *message) +void ConnectionHandler::onError(AMQP::TcpConnection *connection, const char *message) { - std::cout << "ERROR: " - << message - << '\n'; - } - + std::cerr << "AMQP error: " << message << std::endl; + } \ No newline at end of file