Skip to content

Commit

Permalink
pass in queue name to hornetq-run
Browse files Browse the repository at this point in the history
  • Loading branch information
hiredman committed Oct 4, 2010
1 parent a4a164a commit 29197b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/conduit/hornetq.clj
@@ -1,6 +1,7 @@
;;TODO: procs can yield multiple values, how to deal with that with
;;reply queues?
;;TODO: is there some better way to "run procs" on a queue?
;;TODO: auto serialize
(ns conduit.hornetq
(:use [conduit.core])
(:import (org.hornetq.api.core TransportConfiguration SimpleString)
Expand Down Expand Up @@ -139,7 +140,7 @@

(defn hornetq-run
"start a single thread executing a proc"
[{queue :source :as proc} session]
[proc queue session]
(.start session)
(try
(create-queue session queue)
Expand Down
12 changes: 8 additions & 4 deletions test/conduit_hornetq/test/core.clj
Expand Up @@ -16,15 +16,19 @@
(a-arr identity))
pass-through))

(def upcase-queue (str "some.q." (UUID/randomUUID)))

(def upcase (a-hornetq
(str "some.q." (UUID/randomUUID))
upcase-queue
"upcase"
(a-comp deserialize
(a-arr #(.toUpperCase %))
serialize)))

(def evaler-queue (str "some.q." (UUID/randomUUID)))

(def evaler (a-hornetq
(str "some.q." (UUID/randomUUID))
evaler-queue
"eval"
(a-comp deserialize
(a-arr eval)
Expand All @@ -36,12 +40,12 @@
(let [session *session*]
(future
(try
(hornetq-run upcase session)
(hornetq-run upcase upcase-queue session)
(catch Exception e
(.printStackTrace e))))
(future
(try
(hornetq-run evaler session)
(hornetq-run evaler evaler-queue session)
(catch Exception e
(.printStackTrace e)))))
(try
Expand Down

0 comments on commit 29197b5

Please sign in to comment.