     (is (= (take 10 (repeat "kiwi"))
           (loop [i 10, v []] (if (zero? i) v (recur (dec i) (conj v (msg/receive queue :timeout 1000)))))))
     (is (= (take 10 (repeat "starfruit"))
-          (loop [i 10, v []] (if (zero? i) v (recur (dec i) (conj v (msg/receive remote-queue :timeout 1000)))))))))
+          (loop [i 10, v []] (if (zero? i) v (recur (dec i) (conj v (msg/receive local-remote-queue :timeout 1000)))))))))

  (with-open [_ (msg/listen trigger listener :xa true)]
    (msg/publish trigger {:tx? true :rollback? true})
    (is (nil? (msg/receive queue :timeout 1000)))
    (is (nil? (msg/receive remote-queue :timeout 1000)))
    (is (nil? (:a cache)))
    (is (= 10 (:deliveries cache)))))


  (with-open [_ (msg/listen trigger listener)]
    (msg/publish trigger {:tx? true})
    (is (= "kiwi" (msg/receive queue :timeout 1000)))
    (is (= "starfruit" (msg/receive local-remote-queue :timeout 1000)))
    (is (= 1 (:a cache)))))

(deftest transactional-writes-in-listener-should-fail-on-exception
  (with-open [_ (msg/listen trigger listener)]
    (msg/publish trigger {:tx? true :throw? true})
    (is (nil? (msg/receive queue :timeout 1000)))
    (is (nil? (msg/receive local-remote-queue :timeout 1000)))
    (is (nil? (:a cache)))
    (is (= 10 (:deliveries cache)))))

