Class: Basquiat::Adapters::RabbitMq::DeadLettering
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- Basquiat::Adapters::RabbitMq::DeadLettering
- Defined in:
- lib/basquiat/adapters/rabbitmq/requeue_strategies/dead_lettering.rb
Class Attribute Summary collapse
-
.options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(session) ⇒ DeadLettering
constructor
A new instance of DeadLettering.
- #run(message) ⇒ Object
Methods inherited from BaseStrategy
Constructor Details
#initialize(session) ⇒ DeadLettering
Returns a new instance of DeadLettering.
28 29 30 31 |
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/dead_lettering.rb', line 28 def initialize(session) super setup_dead_lettering end |
Class Attribute Details
.options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/dead_lettering.rb', line 8 def @options end |
Class Method Details
.session_options ⇒ Object
23 24 25 |
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/dead_lettering.rb', line 23 def .fetch :session end |
.setup(opts) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/dead_lettering.rb', line 10 def setup(opts) @options = { session: { queue: { options: { 'x-dead-letter-exchange' => opts.fetch(:exchange, 'basquiat.dlx') } } }, dlx: { ttl: opts.fetch(:ttl, 1_000) } } end |
Instance Method Details
#run(message) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/basquiat/adapters/rabbitmq/requeue_strategies/dead_lettering.rb', line 33 def run() catch :skip_processing do (.props.headers) yield end public_send(.action, ) end |