   (:import [org.hornetq.api.core.client HornetQClient]
            [org.hornetq.api.core TransportConfiguration HornetQQueueExistsException]
            [org.hornetq.core.remoting.impl.netty NettyConnectorFactory]))
+
+(def n-messages 20)
 
 (def in-queue (str (java.util.UUID/randomUUID)))
 


(def results (atom []))

(doseq [n (range 11)]
  (let [message (.receive consumer)]
    (.acknowledge message)
    (swap! results conj (read-string (.readString (.getBodyBuffer message))))))

     (onyx.api/shutdown conn)
     (catch Exception e (prn e)))))

(fact @results => (conj (vec (map (fn [x] {:n x}) (range 1 (inc n-messages)))) :done))

