C++ AMQP-CPP RabbitMQ异步基于事件的使用者不消费任何东西

C++ AMQP-CPP RabbitMQ异步基于事件的使用者不消费任何东西,c++,raspberry-pi,amqp,libev,C++,Raspberry Pi,Amqp,Libev,我正在使用AMQ-CPP库()连接到我创建的现有队列,但我无法读取任何内容。我已经测试过队列使用另一个库工作(,它工作,我使用消息),但它使用轮询方法,我需要基于事件的方法 我的代码如下(基于提供的示例): 有什么问题吗?可能我缺少队列的一些配置参数。。。我已经放置了一些调试跟踪,但是没有创建通道。它在连接语句中阻塞: AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://localhost/")); cout &l

我正在使用AMQ-CPP库()连接到我创建的现有队列,但我无法读取任何内容。我已经测试过队列使用另一个库工作(,它工作,我使用消息),但它使用轮询方法,我需要基于事件的方法

我的代码如下(基于提供的示例):

有什么问题吗?可能我缺少队列的一些配置参数。。。我已经放置了一些调试跟踪,但是没有创建通道。它在连接语句中阻塞:

AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://localhost/"));
cout << "I never show up" << endl;

// we need a channel too
AMQP::TcpChannel channel(&connection)
AMQP::tcp连接(&handler,AMQP::Address()amqp://localhost/"));

cout我发现了我的问题:我没有使用declareQueue()方法!事实上,我不得不使用它,但指定了以下参数(与我手动创建队列时所做的相同):


我发现了我的问题:我没有使用declareQueue()方法!事实上,我不得不使用它,但指定了以下参数(与我手动创建队列时所做的相同):

Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux
AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://localhost/"));
cout << "I never show up" << endl;

// we need a channel too
AMQP::TcpChannel channel(&connection)
AMQP::Table arguments;
arguments["x-message-ttl"] = 120 * 1000;

// declare the queue
channel.declareQueue("domoqueue", AMQP::durable + AMQP::passive, arguments).onSuccess(callback);