Class: RabbitMQClient::ReturnedMessageListener

Inherits:
Object
  • Object
show all
Includes:
ReturnListener
Defined in:
lib/jessica/rabbitmq_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(callable) ⇒ ReturnedMessageListener

Returns a new instance of ReturnedMessageListener.



25
26
27
# File 'lib/jessica/rabbitmq_client.rb', line 25

def initialize(callable)
  @callable = callable
end

Instance Method Details

#handleReturn(reply_code, reply_text, exchange, routing_key, properties, body) ⇒ Object



29
30
31
32
33
# File 'lib/jessica/rabbitmq_client.rb', line 29

def handleReturn(reply_code, reply_text, exchange, routing_key, properties, body)
  body_ = String.from_java_bytes(body)
  ret = {:kind => 'RETURN',:reply_code => reply_code, :reply_text => reply_text, :exchange => exchange, :routing_key => routing_key, :properties => properties, :body => body_}
  @callable.call(ret)
end