Skip to content

Commit

Permalink
Change config check from :ziggurat to just :ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
uds5501 committed Nov 12, 2024
1 parent 490adcf commit b9e182b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions resources/config.test.edn
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@
:new-relic {:report-errors false}
:prometheus {:port 8002
:enabled false}
:ssl {:enabled false}
:log-format "text"}}
4 changes: 2 additions & 2 deletions src/ziggurat/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@
(get config :ziggurat))

(defn ssl-config []
(get-in config [:ziggurat :ssl]))
(get-in config [:ssl]))

(defn sasl-config []
(get-in config [:ziggurat :sasl]))
(get-in config [:sasl]))

(defn rabbitmq-config []
(get (ziggurat-config) :rabbit-mq))
Expand Down
8 changes: 6 additions & 2 deletions src/ziggurat/streams.clj
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,19 @@
([global-config stream-config]
(if (:ssl stream-config)
stream-config
(assoc stream-config :ssl (:ssl global-config)))))
(if-let [global-ssl-config (:ssl global-config)]
(assoc stream-config :ssl global-ssl-config)
stream-config))))

(defn- attach-sasl-from-config-if-not-present
([stream-config]
(attach-sasl-from-config-if-not-present (ziggurat-config) stream-config))
([global-config stream-config]
(if (:sasl stream-config)
stream-config
(assoc stream-config :sasl (:sasl global-config)))))
(if-let [global-sasl-config (:sasl global-config)]
(assoc stream-config :sasl global-sasl-config)
stream-config))))

(defn start-streams
([stream-routes]
Expand Down

0 comments on commit b9e182b

Please sign in to comment.