noapte buna

This commit is contained in:
linguini
2026-07-12 02:04:05 +02:00
parent b176a33fc8
commit 222fda251c
2 changed files with 6 additions and 11 deletions
+3 -2
View File
@@ -12,13 +12,14 @@ int main()
ConnectionHandler handler(loop); ConnectionHandler handler(loop);
// make a connection // 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 // we need a channel too
AMQP::TcpChannel channel(&connection); AMQP::TcpChannel channel(&connection);
// create a temporary queue // 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 // report the name of the temporary queue
std::cout << "declared queue " << name << std::endl; std::cout << "declared queue " << name << std::endl;
+2 -8
View File
@@ -12,13 +12,7 @@
std::cout << "AMQP READY\n"; 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: " std::cerr << "AMQP error: " << message << std::endl;
<< message
<< '\n';
} }