Exception: BugBunny::PublishNacked

Inherits:
Error
  • Object
show all
Defined in:
lib/bug_bunny/exception.rb

Overview

Error lanzado cuando el broker responde NACK a una publicación en modo ‘:confirmed`.

Un NACK significa que el broker rechazó explícitamente el mensaje (ej: política de confirms interna, disk full, replicación insuficiente). El mensaje no fue aceptado y se considera no entregado — equivalente a un fallo de transporte desde la perspectiva del publisher.

Se levanta por default desde BugBunny::Producer#confirmed. Para opt-out, configurar ‘BugBunny.configuration.nack_raise = false` o pasar `nack_raise: false` por request.

Examples:

rescue BugBunny::PublishNacked => e
  e.path         # => 'acct.start'
  e.nacked_count # => 1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, nacked_count:) ⇒ PublishNacked

Returns a new instance of PublishNacked.

Parameters:

  • path (String)

    Ruta lógica del request (ej: ‘acct.start’).

  • nacked_count (Integer)

    Cantidad de NACKs reportados por el broker.



46
47
48
49
50
# File 'lib/bug_bunny/exception.rb', line 46

def initialize(path:, nacked_count:)
  @path = path
  @nacked_count = nacked_count
  super("broker NACK on path=#{path} (nacked=#{nacked_count})")
end

Instance Attribute Details

#nacked_countInteger (readonly)

Returns Cantidad de mensajes NACKeados según ‘Bunny::Channel#nacked_set`.

Returns:

  • (Integer)

    Cantidad de mensajes NACKeados según ‘Bunny::Channel#nacked_set`.



42
43
44
# File 'lib/bug_bunny/exception.rb', line 42

def nacked_count
  @nacked_count
end

#pathString (readonly)

Returns La ruta del request cuyo publish fue NACKeado.

Returns:

  • (String)

    La ruta del request cuyo publish fue NACKeado.



39
40
41
# File 'lib/bug_bunny/exception.rb', line 39

def path
  @path
end