Remove messageCounter()

This commit is contained in:
Marcin Gibula 2018-05-14 12:55:15 +02:00
parent bfd91b6ab5
commit e0b04ad7e0
5 changed files with 2 additions and 43 deletions

View File

@ -986,8 +986,6 @@ once).
If server is unable to process a message, it will send send negative acknowledgments. Both
positive and negative acknowledgments handling are implemented as callbacks for Channel object.
There is also helper method messageCounter() that returns number of messages send so far
(note that this value is reset when channel is put in confirm mode).
````c++
// setup ack and nack callbacks
@ -1005,10 +1003,10 @@ channel.onNack([&](uint64 deliveryTag, bool multiple, bool requeue) {
// put channel in confirm mode
channel.setConfirmMode().onSuccess([&]() {
channel.publish("my-exchange", "my-key", "my first message");
// channel.messageCounter() is now 1, will call onAck/onNack with deliverTag=1
// message counter is now 1, will call onAck/onNack with deliverTag=1
channel.publish("my-exchange", "my-key", "my second message");
// channel.messageCounter() is now 2, will call onAck/onNack with deliverTag=2
// message counter is now 2, will call onAck/onNack with deliverTag=2
});
````

View File

@ -138,17 +138,6 @@ public:
return _implementation->setConfirmMode();
}
/**
* Return number of messages sent.
*
* This functions returns number of messages sent. It's reset to zero when channel is
* put into confirm mode.
*/
uint64_t messageCounter() const
{
return _implementation->messageCounter();
}
/**
* Callback that is called when the broker confirmed message publication
*

View File

@ -141,12 +141,6 @@ private:
*/
std::shared_ptr<DeferredReceiver> _receiver;
/**
* Number of messages sent. Used in confirm mode
* @var uint64_t
*/
uint64_t _messageCounter = 0;
/**
* Callback when broker confirmed message publication
* @var SuccessCallback
@ -295,14 +289,6 @@ public:
*/
Deferred &setConfirmMode();
/**
* Return number of messages sent.
*/
uint64_t messageCounter() const
{
return _messageCounter;
}
/**
* Start a transaction
*/
@ -782,14 +768,6 @@ public:
*/
DeferredPublisher *publisher() const { return _publisher.get(); }
/**
* Reset message counter
*/
void resetMessageCounter()
{
_messageCounter = 0;
}
/**
* The channel class is its friend, thus can it instantiate this object
*/

View File

@ -515,9 +515,6 @@ DeferredPublisher &ChannelImpl::publish(const std::string &exchange, const std::
bytesleft -= chunksize;
}
// increment message counter
_messageCounter++;
// done
return *_publisher;
}

View File

@ -74,9 +74,6 @@ public:
// channel does not exist
if(!channel) return false;
// reset message counter
channel->resetMessageCounter();
// report that the channel is open
if (channel->reportSuccess()) channel->onSynchronized();