Skip to content

Commit

Permalink
Make destination creation more idempotentery
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrossley3 committed Oct 15, 2012
1 parent 677d90b commit 5062e46
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@

(defn start-queue [name & {:keys [durable selector] :or {durable true selector ""}}]
(if-let [manager (lookup/fetch "jboss.messaging.default.jms.manager")]
(do (.createQueue manager false name selector durable (into-array String []))
(at-exit #(stop-destination name)))
(if (.createQueue manager false name selector durable (into-array String []))
(at-exit #(stop-destination name)))
(throw (Exception. (str "Unable to start queue, " name)))))

(defn start-topic [name & opts]
(if-let [manager (lookup/fetch "jboss.messaging.default.jms.manager")]
(do (.createTopic manager false name (into-array String []))
(at-exit #(stop-destination name)))
(if (.createTopic manager false name (into-array String []))
(at-exit #(stop-destination name)))
(throw (Exception. (str "Unable to start topic, " name)))))

(defn create-session [^javax.jms.XAConnection connection]
Expand Down

0 comments on commit 5062e46

Please sign in to comment.