Class: RubyRabbitmqJanus::Rabbit::Publisher::NonExclusive

Inherits:
Base
  • Object
show all
Defined in:
lib/rrj/rabbit/publisher/non_exclusive.rb

Overview

Publish message in queue non exclusive. By default “to-janus”. This an option in config to this gem.

Author:

Instance Attribute Summary

Attributes inherited from BaseEvent

#response, #responses

Instance Method Summary collapse

Constructor Details

#initialize(exchange) ⇒ NonExclusive

Define an publisher for create non exclusive queue



12
13
14
15
16
17
# File 'lib/rrj/rabbit/publisher/non_exclusive.rb', line 12

def initialize(exchange)
  @reply = exchange.queue(Tools::Config.instance.queue_from)
  super(exchange)
rescue
  raise Errors::Rabbit::Publisher::NonExclusive::Initialize
end

Instance Method Details

#publish(request) ⇒ Object

Send an message to queue

Parameters:

  • request (String)

    JSON request sending to rabbitmq queue



22
23
24
25
26
# File 'lib/rrj/rabbit/publisher/non_exclusive.rb', line 22

def publish(request)
  super(request)
rescue
  raise Errors::Rabbit::Publisher::NonExclusive::Publish
end