Permalink
Browse files

Wait longer for listen to work, and give a better (but still shitty) …

…error message.

Also fix the listen test to not have to wait for the promise to
timeout.
  • Loading branch information...
tobias committed Mar 6, 2013
1 parent 44d544e commit a98b4da994605fa0f2f6c43f8a5127e82048e0da
@@ -19,13 +19,15 @@
.getContextClassLoader
.toString))))
-(msg/start "queue.listen-id.request")
-(msg/start "queue.listen-id.response")
+(msg/start "queue.listen-id.request" :durable false)
+(msg/start "queue.listen-id.response" :durable false)
(msg/listen "queue.listen-id.request"
(fn [_]
- (msg/listen "queue.listen-id.request"
- (fn [_] (msg/publish "queue.listen-id.response" :new-listener)))
+ (future
+ (msg/listen "queue.listen-id.request"
+ (fn [_] (msg/publish "queue.listen-id.response" :new-listener)))
+ (msg/publish "queue.listen-id.response" :release))
(msg/publish "queue.listen-id.response" :old-listener)))
(msg/start (msg/as-queue "oddball"))
@@ -76,5 +76,6 @@
(deftest listen-on-a-queue-should-be-idempotent
(publish request-queue :whatever)
(is (= :old-listener (receive response-queue)))
+ (is (= :release (receive response-queue)))
(publish request-queue :whatever)
(is (= :new-listener (receive response-queue)))))
@@ -229,9 +229,9 @@
connection
setup-fn
#(deliver complete %))]
- (if (= "up" (deref complete 5000 nil))
+ (if (= "up" (deref complete 10000 nil))
group
- (log/error "Failed to setup listener for" dest-name)))
+ (log/error "Setting up a listener for" dest-name "*may* have failed")))
:else
(throw (IllegalStateException. (str "Destination " dest-name " does not exist."))))))

0 comments on commit a98b4da

Please sign in to comment.