Created
May 22, 2015 15:48
-
-
Save ray1729/cf61989559667682602f to your computer and use it in GitHub Desktop.
Minimal immutant application to test HornetQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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