Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Stomp client library for Clojure.
branch: master
Failed to load latest commit information.
src/clomp rename to clomp
test/clomp rename to clomp
.gitignore rename to clomp
LICENSE initial commit a bit more readme
project.clj rename to clomp
tasks.clj rename to clomp

clj-stomp is a Streaming Text Oriented Messaging Protocol client library for Clojure. Stomp is a text-based wire format that lets clients communicate through a variety Stomp message brokers, providing interoperable, cross-language messaging.

Getting started

Install a stomp broker and start it up. Both StompServer and CoilMQ don't seem to handle ack:auto correctly, so I've been testing with HornetQ.

git clone git://
cd hornetq-stomp
ant server


You can connect to a message broker using a

(require 'stomp)

(with-open [s1 ( "localhost" 61613)
            s2 ( "localhost" 61613)]

  (stomp/with-connection s1 {:login "foo" :password "password"}
    (stomp/send s1 {:destination "/queue/foo"} "blah"))

  (stomp/with-connection s2 {:login "bar" :password "secret"}
    (stomp/subscribe s2 {:destination "/queue/foo"})
    (:body (stomp/receive s2))))

=> "blah"


clj-stomp also supports attaching streams to message queues:

(with-open [s1  ( "localhost" 61613)
            s2  ( "localhost" 61613)
            out (stomp/writer s1 {:destination "/queue/a"})
            in  (stomp/reader s2)]

  (stomp/with-connection s1 {:login "foo" :password "password"}
    (binding [*out* out]
      (println "foo")
      (println "bar")
      (println "baz")))

  (stomp/with-connection s2 {:login "bar" :password "secret"}
    (stomp/subscribe s2 {:destination "/queue/a"})
    (binding [*in* in]

=> ["foo", "bar", "baz"]
Something went wrong with that request. Please try again.