Skip to content

Instantly share code, notes, and snippets.

@ray1729
Created May 22, 2015
Embed
What would you like to do?
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