In java RabbitMQ client I can do (code in ruby):
consumer = QueueingConsumer.new(channel);
channel.basicConsume(queue_name, true, consumer);
consumer.nextDelivery.getBody
And then third line blocks thread until message comes. But how to achieve it in Bunny client? I can only use block:
channel.queue('').bind(@x, :routing_key => rk).subscribe(block: true) do |_, _, payload|
# do something
end
or non blocking pop:
delivery_info, properties, payload = q.pop
Is there a way to achieve it like in jruby client using Bunny? The reason I want is that after receiving a message I would like to continue job in my current context.