Module: AceMQ::AMQP::PublishFailure Private
- Defined in:
- lib/acemq/amqp/transport.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
The sentences a publish that did not arrive comes back with.
In one place because a batch has to raise exactly what a single publish raises: whoever greps a log for one of these should not have to know which of the two paths sent the message, and two copies of a sentence are two sentences waiting to drift apart.
Constant Summary collapse
- UNSENT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
bunny's refusals that are raised before a frame reaches the socket:
ConnectionClosedErrorfrom +send_frame+/+send_frameset+, which checkopen?and raise instead of writing, andChannelAlreadyClosedfrom the first line ofbasic_publish. The same in bunny 2.24 and 3.x. By name, because bunny is loaded lazily and this file must load without it. Only ever asked ofbasic_publish: the same classes out ofwait_for_confirmscome after the write. %w[Bunny::ConnectionClosedError Bunny::ChannelAlreadyClosed].freeze
Class Method Summary collapse
- .not_confirmed(message_id, exchange, routing_key) ⇒ Object private
- .not_published(message_id, exchange, routing_key, reason) ⇒ Object private
- .not_routed(message_id, exchange, routing_key, reason) ⇒ Object private
- .paused(message_id, exchange, routing_key, reason) ⇒ Object private
- .unsent(message_id, exchange, routing_key, error) ⇒ Object private
- .unsent?(error) ⇒ Boolean private
Class Method Details
.not_confirmed(message_id, exchange, routing_key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
82 83 84 85 |
# File 'lib/acemq/amqp/transport.rb', line 82 def not_confirmed(, exchange, routing_key) "the broker would not confirm message #{} on exchange " \ "#{exchange.inspect} with key #{routing_key.inspect}" end |
.not_published(message_id, exchange, routing_key, reason) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
92 93 94 95 |
# File 'lib/acemq/amqp/transport.rb', line 92 def not_published(, exchange, routing_key, reason) "cannot publish message #{} to exchange #{exchange.inspect} " \ "with key #{routing_key.inspect}: #{reason}" end |
.not_routed(message_id, exchange, routing_key, reason) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
87 88 89 90 |
# File 'lib/acemq/amqp/transport.rb', line 87 def not_routed(, exchange, routing_key, reason) "the broker had nowhere to route message #{} published to exchange " \ "#{exchange.inspect} with key #{routing_key.inspect}: #{reason}" end |
.paused(message_id, exchange, routing_key, reason) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
97 98 99 100 101 102 |
# File 'lib/acemq/amqp/transport.rb', line 97 def paused(, exchange, routing_key, reason) not_published(, exchange, routing_key, "the broker has blocked this connection (#{reason}), so the message " \ "was not sent. This is broker capacity, not this message: send it " \ "again once the block clears.") end |
.unsent(message_id, exchange, routing_key, error) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
115 116 117 118 119 120 |
# File 'lib/acemq/amqp/transport.rb', line 115 def unsent(, exchange, routing_key, error) not_published(, exchange, routing_key, "bunny would not write it because the connection or channel is " \ "closed (#{error.class.name}), so the message was not sent. Send it " \ "again once the connection is recovered.") end |
.unsent?(error) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
113 |
# File 'lib/acemq/amqp/transport.rb', line 113 def unsent?(error) = UNSENT.include?(error.class.name) |