noapte buna
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user