(close! rabbit)
Close the connection represented by the given rabbitmq connection map.
Close the connection represented by the given rabbitmq connection map.
(connect! config)
Connect to the rabbitmq service. Accepts a config
map containing several possible options:
Connect to the rabbitmq service. Accepts a `config` map containing several possible options: * :queue - name of the rabbit queue to connect to (default 'sisyphus') * :exchange - name of the exchange to connect to (defaults to global exchange '') * :routing-key - routing key to use for messages (defaults to 'sisyphus') Returns a map containing all of the rabbitmq connection information.
(default-handle-message channel metadata payload)
An example of the handle
argument passed into start-consumer!
. Takes three arguments that
are provided by the rabbit consumer client:
An example of the `handle` argument passed into `start-consumer!`. Takes three arguments that are provided by the rabbit consumer client: * channel - the channel to the rabbit service. * metadata - any information about the incoming message beyond its payload. * payload - bytes representing the message just received.
(publish! rabbit message)
Publish a message on the given rabbitmq connection. The message will be rendered to JSON before sending, so you can pass in any renderable data structure, and strings will be further quoted.
Publish a message on the given rabbitmq connection. The message will be rendered to JSON before sending, so you can pass in any renderable data structure, and strings will be further quoted.
(start-consumer! rabbit handle)
Given the rabbit connection map and a handle
function, start a rabbit consumer listening
to the queue and exchange represented by that connection, which calls handle
each time it
receives a message. The handle
function takes three arguments, channel
, metadata
and
payload
, and an example is given in the below function default-handle-message
in this ns.
Given the rabbit connection map and a `handle` function, start a rabbit consumer listening to the queue and exchange represented by that connection, which calls `handle` each time it receives a message. The `handle` function takes three arguments, `channel`, `metadata` and `payload`, and an example is given in the below function `default-handle-message` in this ns.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close