From 416cc200c61689095ab1e18410fd48894ed44605 Mon Sep 17 00:00:00 2001 From: "shubhang.balkundi" Date: Mon, 11 Apr 2022 20:41:19 +0530 Subject: [PATCH] uses mount/only to start and stop rabbit-mq states --- src/ziggurat/init.clj | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ziggurat/init.clj b/src/ziggurat/init.clj index c9e3b5dd..ac2298c3 100644 --- a/src/ziggurat/init.clj +++ b/src/ziggurat/init.clj @@ -39,9 +39,11 @@ (mount/start)))) (defn- start-rabbitmq-connection [args] - (start* #{#'messaging-connection/consumer-connection} args) - (start* #{#'messaging-connection/connection} args) - (start* #{#'cpool/channel-pool} args)) + (-> (mount/only #{#'messaging-connection/consumer-connection + #'messaging-connection/connection + #'cpool/channel-pool}) + (mount/with-args args) + (mount/start))) (defn- start-rabbitmq-consumers [args] (start-rabbitmq-connection args) @@ -80,9 +82,10 @@ (start-rabbitmq-consumers args)) (defn- stop-rabbitmq-connection [] - (mount/stop #'cpool/channel-pool) - (mount/stop #'connection) - (mount/stop #'messaging-connection/consumer-connection)) + (-> (mount/only #{#'connection + #'cpool/channel-pool + #'messaging-connection/consumer-connection}) + (mount/stop))) (defn stop-kafka-producers [] (mount/stop #'kafka-producers))