mbroadst / qamqp

AMQP 0.9.1 implementation for Qt
Other
151 stars 127 forks source link

Please expose the queue message count when queue was declared #58

Closed ghost closed 7 years ago

mbroadst commented 7 years ago

@hxcan can you please elaborate on this? Also, contributions are more than welcome!

ghost commented 7 years ago

@mbroadst Thanks for the quick reply. https://github.com/mbroadst/qamqp/blob/master/src/qamqpqueue.cpp#L157

When the queue was declared, the remaining amount of messages in the queue was replied to us from the broker. You have already read the "messageCount" field in your code, but just printed it into the logs. I'm developing a client application using qamqp and found that "messageCount" field useful. So I'd like that information to be exposed to client applications.

As for the contribution, I'm quite interested. And I need some suggestions about how to expose that information. Maybe we should add a member variable and the corresponding access functions to QAmqpQueue? Or just add an overloaded signal like declared(int messageCount)? Currently, I'm trying to read and understand your existing code. I'm learning about the Q_D and Q_Q macros used in qamqpqueue.cpp. With the understanding of your code and your suggestions about how to expose that information, I think I can make a contribution.

mbroadst commented 7 years ago

fixed in 65f34967eb9867b8dd820d8c8aaaa2f470aca30e