Exception: AceMQ::AMQP::PublishError

Inherits:
TransportError show all
Defined in:
lib/acemq/amqp/transport.rb

Overview

A message the broker would not take, or took and could not route.

The two are told apart by #unroutable? rather than by two classes, because a caller who only wants to know that the message did not arrive should not have to rescue both. Go and Python split the same failure the same way — a flag on the one error — and the word the telemetry writes is read off it, so the counter and the span cannot disagree about which of the two happened.

Direct Known Subclasses

PublishingPausedError

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, unroutable: false) ⇒ PublishError

Returns a new instance of PublishError.

Parameters:

  • message (String, nil) (defaults to: nil)
  • unroutable (Boolean) (defaults to: false)


50
51
52
53
# File 'lib/acemq/amqp/transport.rb', line 50

def initialize(message = nil, unroutable: false)
  super(message)
  @unroutable = unroutable
end

Instance Method Details

#unroutable? ⇒ Boolean

Whether the broker accepted the message and had nowhere to put it.

False for everything else: a refused publish, a connection that dropped mid-flight, a confirm that never came. Only a mandatory publish can ever set it, because only a mandatory publish is told.

Returns:

  • (Boolean)


46
# File 'lib/acemq/amqp/transport.rb', line 46

def unroutable? = @unroutable