riemann.rabbitmq

Forwards events to RabbitMQ.

rabbitmq

(rabbitmq)(rabbitmq opts)

Accepts options described here and returns a function that, being invoked with options listed below, returns a stream which publishes events to RabbitMQ.

Options:

  • :exchange-settings Settings an exchange is declared with, defaults are:
{:name "riemann"
 :type "topic"
 :durable false
 :auto-delete false
 :internal false}
  • :routing-key Routing key messages to be published with; it can be a function or a string, default is “riemann.events”.
  • :message-properties Properties of messages to publish, defaults are:
{:content-type "application/json"
 :mandatory false}
  • :message-formatter A function to format event(s), default format is JSON.
(def rmq (rabbitmq {:host "riemann.local"
                    :port 1234}))

(changed :state
  (rmq {:exchange-settings {:durable true}
        :routing-key "riemann.events.hello"}))

For details on exchange declaration options and message properties refer to Langohr API reference for declare and publish.