langohr.core

Functions that work with connections and shared features between connections
and channels (e.g. shutdown listeners).

Relevant guides:

 * http://clojurerabbitmq.info/articles/connecting.html
 * http://clojurerabbitmq.info/articles/tls.html

*default-config*

dynamic

Default connection settings.

add-blocked-listener

(add-blocked-listener c on-blocked on-unblocked)
Adds a connection.blocked and connection.unblocked listener
on connection and returns it

add-shutdown-listener

(add-shutdown-listener c f)
Adds a shutdown listener on connection and returns it

automatic-recovery-enabled?

(automatic-recovery-enabled? conn)
Returns true if provided connection uses automatic connection recovery
mode, false otherwise

automatic-topology-recovery-enabled?

(automatic-topology-recovery-enabled? conn)
Returns true if provided connection uses automatic topology recovery
mode, false otherwise

automatically-recover?

deprecated

(automatically-recover? c)
See automatic-recovery-enabled?

blocked-listener

(blocked-listener on-blocked on-unblocked)
Reifies connection.blocked and connection.unblocked listener from Clojure
functions

capabilities-of

(capabilities-of conn)
Returns capabilities of the broker on the other side of the connection

Closeable

protocol

members

close

(close c)
Closes given entity

connect

(connect)(connect settings)
Creates and returns a new connection to RabbitMQ.

create-channel

(create-channel & args)
Delegates to langohr.channel/open, kept for backwards compatibility

exception-handler

(exception-handler {:keys [handle-connection-exception-fn handle-return-listener-exception-fn handle-flow-listener-exception-fn handle-confirm-listener-exception-fn handle-blocked-listener-exception-fn handle-consumer-exception-fn handle-connection-recovery-exception-fn handle-channel-recovery-exception-fn handle-topology-recovery-exception-fn]})

normalize-settings

(normalize-settings config)
For setting maps that contain keys such as :host, :username, :vhost, returns the argument

on-queue-recovery

(on-queue-recovery conn f)
Called when server named queue gets a new name on recovery

on-recovery

(on-recovery target callback)
Registers a network recovery callback on a (Langohr) connection or channel

Openable

protocol

members

closed?

(closed? this)
Checks whether given entity is closed

open?

(open? this)
Checks whether given entity is open

queue-recovery-listener

(queue-recovery-listener f)
Reifies a new queue recovery listener that delegates
to a Clojure function.

settings-from

(settings-from uri)
Parses AMQP connection URI and returns a persistent map of settings

shutdown-listener

(shutdown-listener f)
Adds new shutdown signal listener that delegates to given function

thread-factory-from

(thread-factory-from f)
Instantiates a java.util.concurrent.ThreadFactory that delegates
#newThread to provided Clojure function