when destructing a Tagger class, we now also unset the error-callback (closes #480), at the same time we changed the version number in the Makefile (closes #481)

This commit is contained in:
Emiel Bruijntjes 2022-09-11 20:09:02 +02:00
parent c273d93625
commit c93f2d89ac
4 changed files with 26 additions and 6 deletions

View File

@ -3,7 +3,7 @@ INCLUDE_DIR = ${PREFIX}/include
LIBRARY_DIR = ${PREFIX}/lib
export LIBRARY_NAME = amqpcpp
export SONAME = 4.3
export VERSION = 4.3.15
export VERSION = 4.3.17
all:
$(MAKE) -C src all

View File

@ -1,11 +1,15 @@
/**
* Reliable.h
*
* A channel wrapper based on AMQP::Throttle that allows message callbacks to be installed
* on the publishes, to be called when they are confirmed by the message broker.
* A channel wrapper based on AMQP::Tagger that allows message callbacks to be installed
* on the publish-confirms, to be called when they a confirmation is received from RabbitMQ.
*
* You can also change the base class and use Reliable<Throttle> if you not only
* want to be notified about the publish-confirms, but want to use it for automatic
* throttling at the same time.
*
* @author Michael van der Werve <michael.vanderwerve@mailerq.com>
* @copyright 2020 Copernica BV
* @copyright 2020 - 2022 Copernica BV
*/
/**

View File

@ -1,7 +1,14 @@
/**
* Tagger.h
*
* Base class that enables publisher confirms and keeps track of the sent messages.
* Base class that enables publisher confirms and keeps track of the sent
* messages. You can wrap this class around a AMQP::Channel object and use
* this object for publishing instead. This is a base class that you cannot
* use directly. You should instead use:
*
* - Throttle: to throttle traffic to prevent flooding RabbitMQ
* - Reliable<Tagger>: to be notified about publish-confirms via callbacks
* - Reliable<Throttle>: to have throttle + notifications via callbacks
*
* @author Michael van der Werve <michael.vanderwerve@mailerq.com>
* @copyright 2020 Copernica BV
@ -101,7 +108,7 @@ public:
/**
* Virtual destructor
*/
virtual ~Tagger() = default;
virtual ~Tagger();
/**
* Method to check how many messages are still unacked.

View File

@ -38,6 +38,15 @@ Tagger::Tagger(Channel &channel) : _implementation(channel._implementation)
_implementation->onError([this](const char *message) { reportError(message); });
}
/**
* Destructor
*/
Tagger::~Tagger()
{
// restore the error-callback
_implementation->onError(nullptr);
}
/**
* Send method for a frame
* @param id