Class | Bunny::Queue09 |
In: |
lib/bunny/queue09.rb
|
Parent: | Qrack::Queue |
Queues store and forward messages. Queues can be configured in the server or created at runtime. Queues must be attached to at least one exchange in order to receive messages from publishers.
Acknowledges one or more messages delivered via the Deliver or Get-Ok methods. The client can ask to confirm a single message or a set of messages up to and including a specific message.
@option opts [String] :delivery_tag
@option opts [Boolean] :multiple (false)
If set to @true@, the delivery tag is treated as "up to and including", so that the client can acknowledge multiple messages with a single method. If set to @false@, the delivery tag refers to a single message. If the multiple field is @true@, and the delivery tag is zero, tells the server to acknowledge all outstanding messages.
Binds a queue to an exchange. Until a queue is bound it won‘t receive any messages. Queues are bound to the direct exchange ’’ by default. If error occurs, a {Bunny::ProtocolError} is raised.
@option opts [String] :key
Specifies the routing key for the binding. The routing key is used for routing messages depending on the exchange configuration.
@option opts [Boolean] :nowait (false)
Ignored by Bunny, always @false@.
@return [Symbol] @:bind_ok@ if successful.
@return [Bunny::Consumer] Default consumer associated with this queue (if any), or nil @note Default consumer is the one registered with the convenience {Bunny::Queue#subscribe} method. It has no special properties of any kind. @see Queue#subscribe @see Bunny::Consumer @api public
Requests that a queue is deleted from broker/server. When a queue is deleted any pending messages are sent to a dead-letter queue if this is defined in the server configuration. Removes reference from queues if successful. If an error occurs raises @Bunny::ProtocolError@.
@option opts [Boolean] :if_unused (false)
If set to @true@, the server will only delete the queue if it has no consumers. If the queue has consumers the server does not delete it but raises a channel exception instead.
@option opts [Boolean] :if_empty (false)
If set to @true@, the server will only delete the queue if it has no messages. If the queue is not empty the server raises a channel exception.
@option opts [Boolean] :nowait (false)
Ignored by Bunny, always @false@.
@return [Symbol] @:delete_ok@ if successful
Gets a message from a queue in a synchronous way. If error occurs, raises Bunny::ProtocolError.
@option opts [Boolean] :ack (false)
If set to @false@, the server does not expect an acknowledgement message from the client. If set to @true@, the server expects an acknowledgement message from the client and will re-queue the message if it does not receive one within a time specified by the server.
@return [Hash] Hash with @:header@, @:payload@ and @:delivery_details@ keys. @:delivery_details@ is a hash @:consumer_tag@, @:delivery_tag@, @:redelivered@, @:exchange@ and @:routing_key@. If the queue is empty the returned hash will contain: @{:header => nil, :payload => :queue_empty, :delivery_details => nil}@. N.B. If a block is provided then the hash will be passed into the block and the return value will be nil.
Removes all messages from a queue. It does not cancel consumers. Purged messages are deleted without any formal "undo" mechanism. If an error occurs raises {Bunny::ProtocolError}.
@option opts [Boolean] :nowait (false)
Ignored by Bunny, always @false@.
@return [Symbol] @:purge_ok@ if successful
Removes a queue binding from an exchange. If error occurs, a Bunny::ProtocolError is raised.
@option opts [String] :key
Specifies the routing key for the binding.
@option opts [Boolean] :nowait (false)
Ignored by Bunny, always @false@.
@return [Symbol] @:unbind_ok@ if successful.
Cancels a consumer. This does not affect already delivered messages, but it does mean the server will not send any more messages for that consumer.
@option opts [String] :consumer_tag
Specifies the identifier for the consumer.
@option opts [Boolean] :nowait (false)
Ignored by Bunny, always @false@.
@return [Symbol] @:unsubscribe_ok@ if successful