Skip to content

Commit

Permalink
Add missing recall implementation (#375)
Browse files Browse the repository at this point in the history
* Add missing recall implementation
* create DeferredRecall if it doesn't exist

Co-authored-by: Bas van Berckel <[email protected]>
  • Loading branch information
basvanberckel and Bas van Berckel authored Oct 21, 2020
1 parent cb4bcac commit 1107067
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/channelimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,24 @@ DeferredConsumer& ChannelImpl::consume(const std::string &queue, const std::stri
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
* @param tag the consumer tag
Expand Down

0 comments on commit 1107067

Please sign in to comment.