Class: RubyRabbitmqJanus::Rabbit::Publisher::PublishExclusive
- Inherits:
-
RubyRabbitmqJanus::Rabbit::Publisher
- Object
- RubyRabbitmqJanus::Rabbit::Publisher
- RubyRabbitmqJanus::Rabbit::Publisher::PublishExclusive
- Defined in:
- lib/rrj/rabbit/publish/exclusive.rb
Overview
# Publish message
Publish message in queue exclusive. Bunny create automaticaly a name for this queue. The queue name like to ‘amq.gen-1A456DGVHDVUS’.
Instance Method Summary collapse
-
#initialize(exchange, name_queue) ⇒ PublishExclusive
constructor
Initialize an queue exclusive and generated automaticaly by bunny.
-
#publish(request) ⇒ Janus::Response::Standard
Send an message to queue and waiting a response.
Constructor Details
#initialize(exchange, name_queue) ⇒ PublishExclusive
Initialize an queue exclusive and generated automaticaly by bunny
17 18 19 20 21 22 23 |
# File 'lib/rrj/rabbit/publish/exclusive.rb', line 17 def initialize(exchange, name_queue) @reply = exchange.queue(name_queue, exclusive: true) super(exchange) subscribe_to_queue rescue raise Errors::Rabbit::PublishExclusive::Initialize end |
Instance Method Details
#publish(request) ⇒ Janus::Response::Standard
Send an message to queue and waiting a response
31 32 33 34 35 36 |
# File 'lib/rrj/rabbit/publish/exclusive.rb', line 31 def publish(request) super(request) return_response rescue raise Errors::Rabbit::PublishExclusive::Publish end |