Add missing recall implementation (#375)
* Add missing recall implementation * create DeferredRecall if it doesn't exist Co-authored-by: Bas van Berckel <bas.vanberckel@copernica.com>
This commit is contained in:
parent
cb4bcacc2f
commit
110706771a
|
|
@ -589,6 +589,24 @@ DeferredConsumer& ChannelImpl::consume(const std::string &queue, const std::stri
|
||||||
return *deferred;
|
return *deferred;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell that you are prepared to recall/take back messages that could not be
|
||||||
|
* published. This is only meaningful if you pass the 'immediate' or 'mandatory'
|
||||||
|
* flag to publish() operations.
|
||||||
|
*
|
||||||
|
* THis function returns a deferred handler more or less similar to the object
|
||||||
|
* return by the consume() method and that can be used to install callbacks that
|
||||||
|
* handle the recalled messages.
|
||||||
|
*/
|
||||||
|
DeferredRecall &ChannelImpl::recall()
|
||||||
|
{
|
||||||
|
// create the DeferredRecall if it does not exist
|
||||||
|
if (!_recall) _recall = std::make_shared<DeferredRecall>(this);
|
||||||
|
|
||||||
|
// return the deferred handler
|
||||||
|
return *_recall;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel a running consumer
|
* Cancel a running consumer
|
||||||
* @param tag the consumer tag
|
* @param tag the consumer tag
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue