Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (29 sloc) 807 Bytes

WARNING: THIS LIBRARY IS DEPRECATED. IT WILL NOT WORK WITH LATEST VERSION OF IRONMQ.

IronMQ Clojure Client

Getting Started

Add dependency to your project.clj:

[iron_mq_clojure "1.0.3"]

Require IronMQ client code:

(require '[iron-mq-clojure.client :as mq])

Create IronMQ client:

(def client (mq/create-client "YOUR_TOKEN" "YOUR_PROJECT_ID"))

For Rackspace:

(def client (mq/create-client "YOUR_TOKEN" "YOUR_PROJECT_ID" :host mq/rackspace-host))

Now you can interact with IronMQ:

(mq/post-message client "myqueue" "hello from clojure")

(let [msg (mq/get-message client "myqueue")]
  (if msg
    (do
      (println (get msg "body"))
      (mq/delete-message client "myqueue" msg))
    (println "queue is empty")))