Skip to content

Commit

Permalink
basic_publish: warn when using immediate and mandatory options
Browse files Browse the repository at this point in the history
The AMQP library cannot appropriate handle failures in either of these
cases. It is easy for a channel's SyncSender to become full of
NO_ROUTE messages due to mandatory delivery failing. This effectively
causes a deadlock of the client.
  • Loading branch information
grahamc committed Jan 26, 2018
1 parent c5b7009 commit c022fce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@ impl<'a> Basic<'a> for Channel {
-> AMQPResult<()>
where S: Into<String>
{
if mandatory {
warn!("basic_publish(mandatory=true) failures are not handled and result in blocked channels!");
}

if immediate {
warn!("basic_publish(immediate=true) failures are not handled and result in blocked channels!");
}

let publish = &Publish {
ticket: 0,
exchange: exchange.into(),
Expand Down

0 comments on commit c022fce

Please sign in to comment.