Skip to content

Commit

Permalink
Make sure final-port in langohr.core/open is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Nov 23, 2023
1 parent dee99aa commit a0b4bf7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/clojure/langohr/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,14 @@
cf (ConnectionFactory.)
final-properties (cond-> client-properties
connection-name (assoc "connection_name" connection-name)
update-client-properties update-client-properties)]
(when (or ssl
(= port ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT))
update-client-properties update-client-properties)
tls-expected (or ssl
(not (nil? ssl-context))
(= port ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT))
final-port (or port (if tls-expected
ConnectionFactory/DEFAULT_AMQP_OVER_SSL_PORT
ConnectionFactory/DEFAULT_AMQP_PORT))]
(when tls-expected
(.useSslProtocol cf))
(doto cf
(.setClientProperties final-properties)
Expand Down

0 comments on commit a0b4bf7

Please sign in to comment.