AMQP::Client::Queue
High-level representation of a Queue
Example:
client = AMQP::Client.new.connect
ch = client.channel
q = ch.queue("foobar")
q.bind("amq.fanout", "")
q.subscribe do |msg|
puts msg.body_io
end
Instance methods
bind(exchange : String, routing_key : String, no_wait = false, args arguments : NamedTuple = NamedTuple.new)
SourceBind the queue to an exchange
publish(io : IO, bytesize : Int, mandatory = false, immediate = false, props properties = Properties.new)
Publish a message directly to the queue
publish(message, mandatory = false, immediate = false, props properties = Properties.new)
Publish a message directly to the queue
publish(io : IO, bytesize : Int, mandatory = false, immediate = false, props properties = Properties.new, &blk : Bool -> Nil)
Publish a message directly to the queue, block is called when message is confirmed
publish(message, mandatory = false, immediate = false, props properties = Properties.new, &blk : Bool -> Nil)
Publish a message directly to the queue, block is called when message is confirmed
publish_confirm(io : IO, bytesize : Int, mandatory = false, immediate = false, props properties = Properties.new)
Publish and confirm a message directly to the queue
publish_confirm(message, mandatory = false, immediate = false, props properties = Properties.new)
Publish and confirm a message directly to the queue
subscribe(tag = "", no_ack = true, exclusive = false, block = false, args arguments : NamedTuple = NamedTuple.new, work_pool = 1, &blk : DeliverMessage -> Nil)
Sourcesubscribe(tag = "", no_ack = true, exclusive = false, block = false, args arguments = Arguments.new, work_pool = 1, &blk : DeliverMessage -> Nil)
Consume messages from the queue
See Channel#basic_consume
Unbind the queue from an exchange
unsubscribe(consumer_tag, no_wait = true)
Unsubscribe from the queue
See Channel#basic_cancel for more details