From f6c43d9196d0feb8fcb95c378bcaac54613dc5d8 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Fri, 4 Mar 2016 12:52:36 -0500 Subject: [PATCH] refactor(debug): vastly improve debug messages for framing --- src/qamqpchannel.cpp | 33 +++++++++++++---------- src/qamqpclient.cpp | 55 ++++++++++++++++++-------------------- src/qamqpexchange.cpp | 26 +++++++++++------- src/qamqpqueue.cpp | 61 ++++++++++++++++++++++++++++++++++--------- 4 files changed, 110 insertions(+), 65 deletions(-) diff --git a/src/qamqpchannel.cpp b/src/qamqpchannel.cpp index 6b39f74..8627e67 100644 --- a/src/qamqpchannel.cpp +++ b/src/qamqpchannel.cpp @@ -54,8 +54,6 @@ bool QAmqpChannelPrivate::_q_method(const QAmqpMethodFrame &frame) if (frame.methodClass() != QAmqpFrame::Channel) return false; - qAmqpDebug("Channel#%d:", channelNumber); - switch (frame.id()) { case miOpenOk: openOk(frame); @@ -94,8 +92,9 @@ void QAmqpChannelPrivate::sendFrame(const QAmqpFrame &frame) void QAmqpChannelPrivate::resetInternalState() { - opened = false; - needOpen = true; + if (!opened) return; + opened = false; + needOpen = true; } void QAmqpChannelPrivate::open() @@ -106,7 +105,7 @@ void QAmqpChannelPrivate::open() if (!client->isConnected()) return; - qAmqpDebug("Open channel #%d", channelNumber); + qAmqpDebug("<- channel#open( channel=%d )", channelNumber); QAmqpMethodFrame frame(QAmqpFrame::Channel, miOpen); frame.setChannel(channelNumber); @@ -136,17 +135,19 @@ void QAmqpChannelPrivate::flow(bool active) void QAmqpChannelPrivate::flow(const QAmqpMethodFrame &frame) { Q_UNUSED(frame); - qAmqpDebug() << Q_FUNC_INFO; + qAmqpDebug("-> channel#flow( channel=%d )", channelNumber); } void QAmqpChannelPrivate::flowOk() { - qAmqpDebug() << Q_FUNC_INFO; + qAmqpDebug("<- channel#flowOk( channel=%d )", channelNumber); } void QAmqpChannelPrivate::flowOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpChannel); + qAmqpDebug("-> channel#flowOk( channel=%d )", channelNumber); + QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); bool active = QAmqpFrame::readAmqpField(stream, QAmqpMetaType::Boolean).toBool(); @@ -158,6 +159,9 @@ void QAmqpChannelPrivate::flowOk(const QAmqpMethodFrame &frame) void QAmqpChannelPrivate::close(int code, const QString &text, int classId, int methodId) { + qAmqpDebug("<- channel#close( channel=%d, reply-code=%d, text=%s class-id=%d, method-id:%d, )", + channelNumber, code, qPrintable(text), classId, methodId); + QByteArray arguments; QDataStream stream(&arguments, QIODevice::WriteOnly); @@ -181,7 +185,6 @@ void QAmqpChannelPrivate::close(int code, const QString &text, int classId, int void QAmqpChannelPrivate::close(const QAmqpMethodFrame &frame) { Q_Q(QAmqpChannel); - qAmqpDebug(">> CLOSE"); QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); qint16 code = 0, classId, methodId; @@ -199,11 +202,8 @@ void QAmqpChannelPrivate::close(const QAmqpMethodFrame &frame) Q_EMIT q->error(error); } - qAmqpDebug(">> code: %d", code); - qAmqpDebug(">> text: %s", qPrintable(text)); - qAmqpDebug(">> class-id: %d", classId); - qAmqpDebug(">> method-id: %d", methodId); - Q_EMIT q->closed(); + qAmqpDebug("-> channel#close( channel=%d, reply-code=%d, reply-text=%s, class-id=%d, method-id=%d, )", + channelNumber, code, qPrintable(text), classId, methodId); // complete handshake QAmqpMethodFrame closeOkFrame(QAmqpFrame::Channel, miCloseOk); @@ -216,6 +216,7 @@ void QAmqpChannelPrivate::close(const QAmqpMethodFrame &frame) void QAmqpChannelPrivate::closeOk(const QAmqpMethodFrame &) { + qAmqpDebug("-> channel#closeOk( channel=%d )", channelNumber); notifyClosed(); } @@ -230,7 +231,7 @@ void QAmqpChannelPrivate::notifyClosed() void QAmqpChannelPrivate::openOk(const QAmqpMethodFrame &) { Q_Q(QAmqpChannel); - qAmqpDebug(">> OpenOK"); + qAmqpDebug("-> channel#openOk( channel=%d )", channelNumber); opened = true; Q_EMIT q->opened(); q->channelOpened(); @@ -246,6 +247,7 @@ void QAmqpChannelPrivate::qosOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpChannel); Q_UNUSED(frame) + qAmqpDebug("-> basic#qosOk( channel=%d )", channelNumber); prefetchCount = requestedPrefetchCount; prefetchSize = requestedPrefetchSize; @@ -320,6 +322,9 @@ void QAmqpChannel::qos(qint16 prefetchCount, qint32 prefetchSize) stream << qint16(prefetchCount); stream << qint8(0x0); // global + qAmqpDebug("<- basic#qos( channel=%d, prefetch-size=%d, prefetch-count=%d, global=%d )", + d->channelNumber, prefetchSize, prefetchCount, 0); + frame.setArguments(arguments); d->sendFrame(frame); } diff --git a/src/qamqpclient.cpp b/src/qamqpclient.cpp index da97f43..4b71c8d 100644 --- a/src/qamqpclient.cpp +++ b/src/qamqpclient.cpp @@ -171,10 +171,9 @@ void QAmqpClientPrivate::_q_socketDisconnected() Q_Q(QAmqpClient); buffer.clear(); resetChannelState(); - if (connected) { + if (connected) connected = false; - Q_EMIT q->disconnected(); - } + Q_EMIT q->disconnected(); } void QAmqpClientPrivate::_q_heartbeat() @@ -336,7 +335,6 @@ bool QAmqpClientPrivate::_q_method(const QAmqpMethodFrame &frame) if (frame.methodClass() != QAmqpFrame::Connection) return false; - qAmqpDebug() << "Connection:"; if (closed) { if (frame.id() == QAmqpClientPrivate::miCloseOk) closeOk(frame); @@ -372,7 +370,6 @@ bool QAmqpClientPrivate::_q_method(const QAmqpMethodFrame &frame) void QAmqpClientPrivate::start(const QAmqpMethodFrame &frame) { Q_Q(QAmqpClient); - qAmqpDebug(">> Start"); QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); @@ -387,18 +384,11 @@ void QAmqpClientPrivate::start(const QAmqpMethodFrame &frame) QAmqpFrame::readAmqpField(stream, QAmqpMetaType::LongString).toString().split(' '); QString locales = QAmqpFrame::readAmqpField(stream, QAmqpMetaType::LongString).toString(); - qAmqpDebug(">> version_major: %d", version_major); - qAmqpDebug(">> version_minor: %d", version_minor); - - // NOTE: replace with qDebug overload - // QAmqpFrame::print(table); - - qAmqpDebug() << ">> mechanisms: " << mechanisms; - qAmqpDebug(">> locales: %s", qPrintable(locales)); + qAmqpDebug("-> connection#start( version_major=%d, version_minor=%d, mechanisms=(%s), locales=%s", + version_major, version_minor, qPrintable(mechanisms.join(',')), qPrintable(locales)); if (!mechanisms.contains(authenticator->type())) { socket->disconnectFromHost(); - Q_EMIT q->disconnected(); return; } @@ -408,12 +398,11 @@ void QAmqpClientPrivate::start(const QAmqpMethodFrame &frame) void QAmqpClientPrivate::secure(const QAmqpMethodFrame &frame) { Q_UNUSED(frame) - qAmqpDebug() << Q_FUNC_INFO << "called!"; + qAmqpDebug("-> connection#secure()"); } void QAmqpClientPrivate::tune(const QAmqpMethodFrame &frame) { - qAmqpDebug(">> Tune"); QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); @@ -430,9 +419,8 @@ void QAmqpClientPrivate::tune(const QAmqpMethodFrame &frame) channelMax = !channelMax ? channel_max : qMax(channel_max, channelMax); heartbeatDelay = !heartbeatDelay ? heartbeat_delay: heartbeatDelay; - qAmqpDebug(">> channel_max: %d", channelMax); - qAmqpDebug(">> frame_max: %d", frameMax); - qAmqpDebug(">> heartbeat: %d", heartbeatDelay); + qAmqpDebug("-> connection#tune( channel_max=%d, frame_max=%d, heartbeat=%d )", + channelMax, frameMax, heartbeatDelay); if (heartbeatTimer) { heartbeatTimer->setInterval(heartbeatDelay * 1000); @@ -450,27 +438,25 @@ void QAmqpClientPrivate::openOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpClient); Q_UNUSED(frame) - qAmqpDebug(">> OpenOK"); + qAmqpDebug("-> connection#openOk()"); connected = true; Q_EMIT q->connected(); } void QAmqpClientPrivate::closeOk(const QAmqpMethodFrame &frame) { - Q_Q(QAmqpClient); Q_UNUSED(frame) - qAmqpDebug() << Q_FUNC_INFO << "received"; + qAmqpDebug("-> connection#closeOk()"); + connected = false; if (heartbeatTimer) heartbeatTimer->stop(); socket->disconnectFromHost(); - Q_EMIT q->disconnected(); } void QAmqpClientPrivate::close(const QAmqpMethodFrame &frame) { Q_Q(QAmqpClient); - qAmqpDebug(">> CLOSE"); QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); qint16 code = 0, classId, methodId; @@ -479,10 +465,8 @@ void QAmqpClientPrivate::close(const QAmqpMethodFrame &frame) stream >> classId; stream >> methodId; - qAmqpDebug(">> code: %d", code); - qAmqpDebug(">> text: %s", qPrintable(text)); - qAmqpDebug(">> class-id: %d", classId); - qAmqpDebug(">> method-id: %d", methodId); + qAmqpDebug("-> connection#close( reply-code=%d, reply-text=%s, class-id=%d, method-id:%d )", + code, qPrintable(text), classId, methodId); QAMQP::Error checkError = static_cast(code); if (checkError != QAMQP::NoError) { @@ -507,6 +491,7 @@ void QAmqpClientPrivate::close(const QAmqpMethodFrame &frame) // complete handshake QAmqpMethodFrame closeOkFrame(QAmqpFrame::Connection, QAmqpClientPrivate::miCloseOk); + qAmqpDebug("<- connection#closeOk()"); sendFrame(closeOkFrame); } @@ -525,14 +510,15 @@ void QAmqpClientPrivate::startOk() authenticator->write(stream); QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortString, QLatin1String("en_US")); - frame.setArguments(arguments); + + qAmqpDebug("<- connection#startOk()"); // @todo: fill this out sendFrame(frame); } void QAmqpClientPrivate::secureOk() { - qAmqpDebug() << Q_FUNC_INFO; + qAmqpDebug("-> connection#secureOk()"); } void QAmqpClientPrivate::tuneOk() @@ -545,6 +531,9 @@ void QAmqpClientPrivate::tuneOk() stream << qint32(frameMax); stream << qint16(heartbeatDelay); + qAmqpDebug("<- connection#tuneOk( channelMax=%d, frameMax=%d, heartbeatDelay=%d", + channelMax, frameMax, heartbeatDelay); + frame.setArguments(arguments); sendFrame(frame); } @@ -560,6 +549,9 @@ void QAmqpClientPrivate::open() stream << qint8(0); stream << qint8(0); + qAmqpDebug("<- connection#open( virtualHost=%s, reserved-1=%d, reserved-2=%d", + qPrintable(virtualHost), 0, 0); + frame.setArguments(arguments); sendFrame(frame); } @@ -573,6 +565,9 @@ void QAmqpClientPrivate::close(int code, const QString &text, int classId, int m stream << qint16(classId); stream << qint16(methodId); + qAmqpDebug("<- connection#close( reply-code=%d, reply-text=%s, class-id=%d, method-id:%d )", + code, qPrintable(text), classId, methodId); + QAmqpMethodFrame frame(QAmqpFrame::Connection, QAmqpClientPrivate::miClose); frame.setArguments(arguments); sendFrame(frame); diff --git a/src/qamqpexchange.cpp b/src/qamqpexchange.cpp index 6015780..d29e3d9 100644 --- a/src/qamqpexchange.cpp +++ b/src/qamqpexchange.cpp @@ -62,6 +62,11 @@ void QAmqpExchangePrivate::declare() stream << qint8(options); QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::Hash, arguments); + qAmqpDebug("<- exchange#declare( name=%s, type=%s, passive=%d, durable=%d, no-wait=%d )", + qPrintable(name), qPrintable(type), + options.testFlag(QAmqpExchange::Passive), options.testFlag(QAmqpExchange::Durable), + options.testFlag(QAmqpExchange::NoWait)); + frame.setArguments(args); sendFrame(frame); delayedDeclare = false; @@ -113,9 +118,8 @@ bool QAmqpExchangePrivate::_q_method(const QAmqpMethodFrame &frame) void QAmqpExchangePrivate::declareOk(const QAmqpMethodFrame &frame) { Q_UNUSED(frame) - Q_Q(QAmqpExchange); - qAmqpDebug() << "declared exchange: " << name; + qAmqpDebug("-> exchange[ %s ]#declareOk()", qPrintable(name)); declared = true; Q_EMIT q->declared(); } @@ -123,9 +127,8 @@ void QAmqpExchangePrivate::declareOk(const QAmqpMethodFrame &frame) void QAmqpExchangePrivate::deleteOk(const QAmqpMethodFrame &frame) { Q_UNUSED(frame) - Q_Q(QAmqpExchange); - qAmqpDebug() << "deleted exchange: " << name; + qAmqpDebug("-> exchange#deleteOk[ %s ]()", qPrintable(name)); declared = false; Q_EMIT q->removed(); } @@ -133,7 +136,7 @@ void QAmqpExchangePrivate::deleteOk(const QAmqpMethodFrame &frame) void QAmqpExchangePrivate::_q_disconnected() { QAmqpChannelPrivate::_q_disconnected(); - qAmqpDebug() << "exchange " << name << " disconnected"; + qAmqpDebug() << "exchange disconnected: " << name; delayedDeclare = false; declared = false; unconfirmedDeliveryTags.clear(); @@ -158,10 +161,8 @@ void QAmqpExchangePrivate::basicReturn(const QAmqpMethodFrame &frame) Q_EMIT q->error(error); } - qAmqpDebug(">> replyCode: %d", replyCode); - qAmqpDebug(">> replyText: %s", qPrintable(replyText)); - qAmqpDebug(">> exchangeName: %s", qPrintable(exchangeName)); - qAmqpDebug(">> routingKey: %s", qPrintable(routingKey)); + qAmqpDebug("-> basic#return( reply-code=%d, reply-text=%s, exchange=%s, routing-key=%s )", + replyCode, qPrintable(replyText), qPrintable(exchangeName), qPrintable(routingKey)); } void QAmqpExchangePrivate::handleAckOrNack(const QAmqpMethodFrame &frame) @@ -266,6 +267,9 @@ void QAmqpExchange::remove(int options) QAmqpFrame::writeAmqpField(stream, QAmqpMetaType::ShortString, d->name); stream << qint8(options); + qAmqpDebug("<- exchange#delete( exchange=%s, if-unused=%d, no-wait=%d )", + qPrintable(d->name), options & QAmqpExchange::roIfUnused, options & QAmqpExchange::roNoWait); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -305,6 +309,10 @@ void QAmqpExchange::publish(const QByteArray &message, const QString &routingKey QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, routingKey); out << qint8(publishOptions); + qAmqpDebug("<- basic#publish( exchange=%s, routing-key=%s, mandatory=%d, immediate=%d )", + qPrintable(d->name), qPrintable(routingKey), + publishOptions & QAmqpExchange::poMandatory, publishOptions & QAmqpExchange::poImmediate); + frame.setArguments(arguments); d->sendFrame(frame); diff --git a/src/qamqpqueue.cpp b/src/qamqpqueue.cpp index da19e5c..6546c5e 100644 --- a/src/qamqpqueue.cpp +++ b/src/qamqpqueue.cpp @@ -147,7 +147,6 @@ void QAmqpQueuePrivate::_q_body(const QAmqpContentBodyFrame &frame) void QAmqpQueuePrivate::declareOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpQueue); - qAmqpDebug() << "declared queue: " << name; declared = true; QByteArray data = frame.arguments(); @@ -156,7 +155,9 @@ void QAmqpQueuePrivate::declareOk(const QAmqpMethodFrame &frame) name = QAmqpFrame::readAmqpField(stream, QAmqpMetaType::ShortString).toString(); qint32 messageCount = 0, consumerCount = 0; stream >> messageCount >> consumerCount; - qAmqpDebug("message count %d\nConsumer count: %d", messageCount, consumerCount); + + qAmqpDebug("-> queue#declareOk( queue-name=%s, message-count=%d, consumer-count=%d )", + qPrintable(name), messageCount, consumerCount); Q_EMIT q->declared(); } @@ -164,28 +165,31 @@ void QAmqpQueuePrivate::declareOk(const QAmqpMethodFrame &frame) void QAmqpQueuePrivate::purgeOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpQueue); - qAmqpDebug() << "purged queue: " << name; - QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); qint32 messageCount = 0; stream >> messageCount; + qAmqpDebug("-> queue#purgeOk( queue-name=%s, message-count=%d )", + qPrintable(name), messageCount); + Q_EMIT q->purged(messageCount); } void QAmqpQueuePrivate::deleteOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpQueue); - qAmqpDebug() << "deleted queue: " << name; declared = false; QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); qint32 messageCount = 0; stream >> messageCount; - qAmqpDebug("Message count %d", messageCount); + + qAmqpDebug("-> queue#deleteOk( queue-name=%s, message-count=%d )", + qPrintable(name), messageCount); + Q_EMIT q->removed(); } @@ -193,23 +197,23 @@ void QAmqpQueuePrivate::deleteOk(const QAmqpMethodFrame &frame) void QAmqpQueuePrivate::bindOk(const QAmqpMethodFrame &frame) { Q_UNUSED(frame) - Q_Q(QAmqpQueue); - qAmqpDebug() << Q_FUNC_INFO << "bound to exchange"; + qAmqpDebug("-> queue[ %s ]#bindOk()", qPrintable(name)); Q_EMIT q->bound(); } void QAmqpQueuePrivate::unbindOk(const QAmqpMethodFrame &frame) { Q_UNUSED(frame) - Q_Q(QAmqpQueue); - qAmqpDebug() << Q_FUNC_INFO << "unbound from exchange"; + qAmqpDebug("-> queue[ %s ]#unbindOk()", qPrintable(name)); Q_EMIT q->unbound(); } void QAmqpQueuePrivate::getOk(const QAmqpMethodFrame &frame) { + qAmqpDebug("-> queue[ %s ]#getOk()", qPrintable(name)); + QByteArray data = frame.arguments(); QDataStream in(&data, QIODevice::ReadOnly); @@ -224,13 +228,14 @@ void QAmqpQueuePrivate::getOk(const QAmqpMethodFrame &frame) void QAmqpQueuePrivate::consumeOk(const QAmqpMethodFrame &frame) { Q_Q(QAmqpQueue); - qAmqpDebug() << "consume ok: " << name; QByteArray data = frame.arguments(); QDataStream stream(&data, QIODevice::ReadOnly); consumerTag = QAmqpFrame::readAmqpField(stream, QAmqpMetaType::ShortString).toString(); - qAmqpDebug("consumer tag = %s", qPrintable(consumerTag)); consuming = true; consumeRequested = false; + + qAmqpDebug("-> queue[ %s ]#consumeOk( consumer-tag=%s )", qPrintable(name), qPrintable(consumerTag)); + Q_EMIT q->consuming(consumerTag); } @@ -266,6 +271,11 @@ void QAmqpQueuePrivate::declare() out << qint8(options); QAmqpFrame::writeAmqpField(out, QAmqpMetaType::Hash, arguments); + qAmqpDebug("<- queue#declare( queue=%s, passive=%d, durable=%d, exclusive=%d, auto-delete=%d, no-wait=%d )", + qPrintable(name), options & QAmqpQueue::Passive, options & QAmqpQueue::Durable, + options & QAmqpQueue::Exclusive, options & QAmqpQueue::AutoDelete, + options & QAmqpQueue::NoWait); + frame.setArguments(arguments); sendFrame(frame); @@ -285,6 +295,8 @@ void QAmqpQueuePrivate::cancelOk(const QAmqpMethodFrame &frame) return; } + qAmqpDebug("-> queue[ %s ]#cancelOk( consumer-tag=%s )", qPrintable(name), qPrintable(consumerTag)); + consumerTag.clear(); consuming = false; consumeRequested = false; @@ -360,6 +372,9 @@ void QAmqpQueue::remove(int options) QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, d->name); out << qint8(options); + qAmqpDebug("<- queue#delete( queue=%s, if-unused=%d, if-empty=%d )", + qPrintable(d->name), options & QAmqpQueue::roIfUnused, options & QAmqpQueue::roIfEmpty); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -380,6 +395,8 @@ void QAmqpQueue::purge() QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, d->name); out << qint8(0); // no-wait + qAmqpDebug("<- queue#purge( queue=%s, no-wait=%d )", qPrintable(d->name), 0); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -416,6 +433,10 @@ void QAmqpQueue::bind(const QString &exchangeName, const QString &key) out << qint8(0); // no-wait QAmqpFrame::writeAmqpField(out, QAmqpMetaType::Hash, QAmqpTable()); + qAmqpDebug("<- queue#bind( queue=%s, exchange=%s, routing-key=%s, no-wait=%d )", + qPrintable(d->name), qPrintable(exchangeName), qPrintable(key), + 0); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -449,6 +470,9 @@ void QAmqpQueue::unbind(const QString &exchangeName, const QString &key) QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, key); QAmqpFrame::writeAmqpField(out, QAmqpMetaType::Hash, QAmqpTable()); + qAmqpDebug("<- queue#unbind( queue=%s, exchange=%s, routing-key=%s )", + qPrintable(d->name), qPrintable(exchangeName), qPrintable(key)); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -484,6 +508,11 @@ bool QAmqpQueue::consume(int options) out << qint8(options); QAmqpFrame::writeAmqpField(out, QAmqpMetaType::Hash, QAmqpTable()); + qAmqpDebug("<- basic#consume( queue=%s, consumer-tag=%s, no-local=%d, no-ack=%d, exclusive=%d, no-wait=%d )", + qPrintable(d->name), qPrintable(d->consumerTag), + options & QAmqpQueue::coNoLocal, options & QAmqpQueue::coNoAck, + options & QAmqpQueue::coExclusive, options & QAmqpQueue::coNoWait); + frame.setArguments(arguments); d->sendFrame(frame); d->consumeRequested = true; @@ -532,6 +561,8 @@ void QAmqpQueue::get(bool noAck) QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, d->name); out << qint8(noAck ? 1 : 0); // no-ack + qAmqpDebug("<- basic#get( queue=%s, no-ack=%d )", qPrintable(d->name), noAck); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -558,6 +589,8 @@ void QAmqpQueue::ack(qlonglong deliveryTag, bool multiple) out << deliveryTag; out << qint8(multiple ? 1 : 0); // multiple + qAmqpDebug("<- basic#ack( delivery-tag=%llu, multiple=%d )", deliveryTag, multiple); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -584,6 +617,8 @@ void QAmqpQueue::reject(qlonglong deliveryTag, bool requeue) out << deliveryTag; out << qint8(requeue ? 1 : 0); + qAmqpDebug("<- basic#reject( delivery-tag=%llu, requeue=%d )", deliveryTag, requeue); + frame.setArguments(arguments); d->sendFrame(frame); } @@ -610,6 +645,8 @@ bool QAmqpQueue::cancel(bool noWait) QAmqpFrame::writeAmqpField(out, QAmqpMetaType::ShortString, d->consumerTag); out << (noWait ? qint8(0x01) : qint8(0x0)); + qAmqpDebug("<- basic#cancel( consumer-tag=%s, no-wait=%d )", qPrintable(d->consumerTag), noWait); + frame.setArguments(arguments); d->sendFrame(frame); return true;