Liking cljdoc? Tell your friends :D

langohr.queue

Functions that provide operations on queues.

Relevant guides:

http://clojurerabbitmq.info/articles/queues.html

Functions that provide operations on queues.

Relevant guides:

http://clojurerabbitmq.info/articles/queues.html
raw docstring

bindclj

(bind ch queue exchange)
(bind ch
      queue
      exchange
      {:keys [routing-key arguments] :or {routing-key "" arguments nil}})

Binds a queue to an exchange using queue.bind AMQP method

Binds a queue to an exchange using queue.bind AMQP method
sourceraw docstring

consumer-countclj

(consumer-count ch queue)

Returns a number of active consumers on the queue

Returns a number of active consumers on the queue
sourceraw docstring

declareclj

(declare ch)
(declare ch queue)
(declare ch
         queue
         {:keys [durable exclusive auto-delete arguments]
          :or {durable false exclusive false auto-delete true}})

Actively declare a server-named or named queue using queue.declare AMQP method.

Usage example:

;; declare server-named, exclusive, autodelete, non-durable queue.
(lhq/declare channel) ;; will return a map that contains the name: {:queue "amq.gen-QtE7OdDDjlHcxNGWuSoUb3"}

;; creates named non-durable, exclusive, autodelete queue
(lhq/declare channel queue-name {:durable false :exclusive true :auto-delete true})

Options

:durable (default: false): indicates wether the queue is durable. Durable queue will survive server restart. Durable queues do not neccessarily hold persistent messages. Using persistent messages with transient queues is allowed, but will not save messages between restarts. :exclusive (default: false): when set to true, indicates that the queue is exclusive. No other subscriber can consume form that queue. Exclusive always implies auto-delete, as messages are delivered to the single consumer. When set to false, allows multiple consumers. :auto-delete (default: true): when set to true, queue will be purged as soon as last consumer stops is finished using it. If consumer never got attached to the queue, it won't get deleted.

:arguments: other properties for the Queue.

Actively declare a server-named or named queue using queue.declare AMQP method.

Usage example:

    ;; declare server-named, exclusive, autodelete, non-durable queue.
    (lhq/declare channel) ;; will return a map that contains the name: {:queue "amq.gen-QtE7OdDDjlHcxNGWuSoUb3"}

    ;; creates named non-durable, exclusive, autodelete queue
    (lhq/declare channel queue-name {:durable false :exclusive true :auto-delete true})

Options

 :durable (default: false): indicates wether the queue is durable. Durable queue will survive server restart. Durable queues do not neccessarily hold persistent messages. Using persistent messages with transient queues is allowed, but will not save messages between restarts.
 :exclusive (default: false): when set to true, indicates that the queue is exclusive. No other subscriber can consume form that queue. Exclusive always implies auto-delete, as messages are delivered to the single consumer. When set to false, allows multiple consumers.
 :auto-delete (default: true): when set to true, queue will be purged as soon as last consumer stops is finished using it. If consumer never got attached to the queue, it won't get deleted.

 :arguments: other properties for the Queue.
sourceraw docstring

declare-passiveclj

(declare-passive ch queue)

Declares a queue passively (checks that it is there) using queue.declare AMQP method

Declares a queue passively (checks that it is there) using queue.declare AMQP method
sourceraw docstring

declare-server-namedclj

(declare-server-named ch)
(declare-server-named ch
                      {:keys [durable exclusive auto-delete arguments]
                       :or {durable false exclusive false auto-delete true}})

Declares a server-named queue and returns its name.

Declares a server-named queue and returns its name.
sourceraw docstring

deleteclj

(delete ch queue)
(delete ch queue if-unused if-empty)

Deletes a queue using queue.delete AMQP method

Deletes a queue using queue.delete AMQP method
sourceraw docstring

empty?clj

(empty? ch queue)

Returns true if queue is empty (has no messages ready), false otherwise

Returns true if queue is empty (has no messages ready), false otherwise
sourceraw docstring

message-countclj

(message-count ch queue)

Returns a number of messages that are ready for delivery (e.g. not pending acknowledgements) in the queue

Returns a number of messages that are ready for delivery (e.g. not pending acknowledgements)
in the queue
sourceraw docstring

purgeclj

(purge ch queue)

Purges a queue using queue.purge AMQP method

Purges a queue using queue.purge AMQP method
sourceraw docstring

statusclj

(status ch queue)

Returns a map with two keys: message-count and :consumer-count, for the given queue. Uses queue.declare AMQP method with the :passive attribute set.

Returns a map with two keys: message-count and :consumer-count, for the given queue.
Uses queue.declare AMQP method with the :passive attribute set.
sourceraw docstring

unbindclj

(unbind ch queue exchange)
(unbind ch queue exchange routing-key)
(unbind ch queue exchange routing-key arguments)

Unbinds a queue from an exchange using queue.bind AMQP method

Unbinds a queue from an exchange using queue.bind AMQP method
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close