first commit

This commit is contained in:
linguini
2026-07-12 01:38:38 +02:00
commit b176a33fc8
6 changed files with 105 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#include "src/rmq/ConnectionHandler.hpp"
#include <iostream>
#include <amqpcpp.h>
#include <uv.h>
int main()
{
// access to the event loop
auto *loop = uv_default_loop();
// handler for libev
ConnectionHandler handler(loop);
// make a connection
AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://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) {
// report the name of the temporary queue
std::cout << "declared queue " << name << std::endl;
});
// run the loop
uv_run(loop, UV_RUN_DEFAULT);
// done
return 0;
}