QAMQP icon indicating copy to clipboard operation
QAMQP copied to clipboard

Do not receive declared signal from QAMQP::Queue

Open davidip opened this issue 12 years ago • 1 comments
trafficstars

Thank you for QAMQP. I am using the sample code snippet (shown below) from ReceiveLog.h in my Qt application. I just try to see whether I can make connection and binding to the RabbitMQ server.

    // Create AMQP client
    QString address("amqp://guest:[email protected]:5672/");
    QAMQP::Client* client = new QAMQP::Client(this);
    client->open(QUrl(address));

    // Create an exclusive queue
    queue_ = client->createQueue();
    queue_->declare("", Queue::Exclusive);

    connect(queue_, SIGNAL(declared()), this, SLOT(declared()));
    connect(queue_, SIGNAL(messageReceived()), this, SLOT(newMessage()));

Apparently the connection is OK according to the debugging outputs shown below. But there is never a signal emitted for declared() so my slot function was never called. I searched the amqp_queue.cpp source code and I don't see "emit declared()". Are the sample code up-to-date? Thank you for your help.

Debug output on the console: Connection:

Start version_major: 0 version_minor: 9 version : QVariant(QString, "3.0.4") product : QVariant(QString, "RabbitMQ") platform : QVariant(QString, "Erlang/OTP") capabilities : FIELD_TABLE copyright : QVariant(QString, "Copyright (C) 2007-2013 VMware, Inc.") information : QVariant(QString, "Licensed under the MPL. See http://www.rabbitmq.com/") mechanisms: PLAIN AMQPLAIN locales: en_US Connection: Tune channel_max: 0 frame_max: 131072 heartbeat: 600 Connection: OpenOK Open channel #1 Channel#1:

davidip avatar Sep 25 '13 21:09 davidip

Emit does't call directly. Emit is called in file amqp_queue.cpp, line 275.

You can try old example: https://github.com/fuCtor/QAMQP/blob/e56a6afa9d0f39f5c4af45500c07c9f7980cf2ec/src/test.cpp

fuCtor avatar Sep 29 '13 07:09 fuCtor