Class: RabbitMQClient::QueueConsumer
- Inherits:
-
DefaultConsumer
- Object
- DefaultConsumer
- RabbitMQClient::QueueConsumer
- Defined in:
- lib/rabbitmq_client.rb
Instance Method Summary collapse
- #handleDelivery(consumer_tag, envelope, properties, body) ⇒ Object
-
#initialize(channel, block) ⇒ QueueConsumer
constructor
A new instance of QueueConsumer.
Constructor Details
#initialize(channel, block) ⇒ QueueConsumer
Returns a new instance of QueueConsumer.
23 24 25 26 27 |
# File 'lib/rabbitmq_client.rb', line 23 def initialize(channel, block) @channel = channel @block = block super(channel) end |
Instance Method Details
#handleDelivery(consumer_tag, envelope, properties, body) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/rabbitmq_client.rb', line 29 def handleDelivery(consumer_tag, envelope, properties, body) delivery_tag = envelope.get_delivery_tag = Marshal.load(String.from_java_bytes(body)) # TODO: Do we need to do something with properties? @block.call @channel.basic_ack(delivery_tag, false) end |