Hi, This question is related to blocking issue that I'm asking <https://github.com/michaelklishin/langohr/issues/74>, but I think better separating this to prevent putting more noises in that issue. I started to think that the issue that happens to me causes by opening and closing channel to often in the subscribe handler function (the snippet below extracted from here <https://github.com/michaelklishin/langohr/issues/74#issuecomment-123536849> )
(lc/subscribe channel "source" (fn [ch meta message] (let [pub-ch (lch/open conn)] (lb/publish pub-ch "" "destination" (str message)) (lch/close pub-ch)) (lb/ack ch (:delivery-tag meta)))) The reason I keep doing it this way is because in the Java RabbitMQ client Channel documentation <https://www.rabbitmq.com/releases/rabbitmq-java-client/current-javadoc/com/rabbitmq/client/Channel.html> says that a channel shouldn't be shared between threads. As my understanding, message handler function can be executed in multiple threads that's why I create a new channel and close it within the handler function. But from my other test results, it seems like sharing channel between threads making handler function run a lot faster and importantly, blocking issue doesn't happen. Below are the variation of the codes I've tried. (lc/subscribe channel "source" (fn [ch meta message] (lb/publish ch "" "destination" (str message)) (lb/ack ch (:delivery-tag meta)))) and (let [conn (connect) channel (lch/open conn) channel2 (lch/open conn)] (lq/declare channel "destination") (lc/subscribe channel "source" (fn [ch meta message] (lb/publish channel2 "" "destination" (str message)) (lb/ack ch (:delivery-tag meta))))) I wonder if these two approaches are safe to use? Thanks, - Tap -- You received this message because you are subscribed to the Google Groups "clojure-rabbitmq" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure-rabbitmq+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.