Skip to content

Instantly share code, notes, and snippets.

@ray1729
Created May 22, 2015 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ray1729/cf61989559667682602f to your computer and use it in GitHub Desktop.
Save ray1729/cf61989559667682602f to your computer and use it in GitHub Desktop.
Minimal immutant application to test HornetQ
(ns hornetq-test.core
(:require [immutant.messaging :as msg]
[immutant.util])
(:gen-class))
(def running? (atom true))
(def uniq (rand-int 1000000))
(defn do-stuff []
(let [t (msg/topic "stuff")]
(msg/listen t println)
(while @running?
(msg/publish t (str "hello from " uniq))
(Thread/sleep 5000))))
(defn -main []
(future (do-stuff))
(immutant.util/at-exit #(reset! running? false)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment