Skip to content

Commit

Permalink
Merge pull request #122 from vincentjames501/fix/121
Browse files Browse the repository at this point in the history
Fix #121 by bumping dependencies and adding additional ConnectionFactory opts
  • Loading branch information
michaelklishin authored Oct 23, 2024
2 parents f4e09f9 + 7dc4aee commit 21efe4a
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 11 deletions.
14 changes: 7 additions & 7 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
:description "A Clojure client for RabbitMQ that embraces the underlying protocol. Built on top of the RabbitMQ Java client"
:min-lein-version "2.5.1"
:license {:name "Eclipse Public License"}
:dependencies [[org.clojure/clojure "1.11.1"]
[com.rabbitmq/amqp-client "5.20.0"]
[clojurewerkz/support "1.1.0" :exclusions [com.google.guava/guava]]
[clj-http "3.12.3"]
[hato "0.9.0"]
[cheshire "5.12.0"]]
:dependencies [[org.clojure/clojure "1.12.0"]
[com.rabbitmq/amqp-client "5.22.0"]
[clojurewerkz/support "1.5.0" :exclusions [com.google.guava/guava]]
[clj-http "3.13.0"]
[hato "1.0.0"]
[cheshire "5.13.0"]]
:profiles {:1.10 {:dependencies [[org.clojure/clojure "1.10.2"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:master {:dependencies [[org.clojure/clojure "1.12.0-master-SNAPSHOT"]]}
:dev {:dependencies [[org.clojure/tools.cli "0.4.1" :exclusions [org.clojure/clojure]]]
:dev {:dependencies [[org.clojure/tools.cli "1.1.230" :exclusions [org.clojure/clojure]]]
:resource-paths ["test/resources"]
:plugins [[lein-codox "0.10.8"]]
:codox {:source-paths ["src/clojure"]
Expand Down
68 changes: 64 additions & 4 deletions src/clojure/langohr/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,15 @@
[settings]
(let [{:keys [host port username password vhost
requested-heartbeat connection-timeout ssl ssl-context verify-hostname socket-factory sasl-config
requested-channel-max thread-factory exception-handler
connection-name update-client-properties topology-recovery-retry-handler]
requested-channel-max thread-factory exception-handler ssl-context-factory
credentials-provider metrics-collector requested-frame-max handshake-timeout shutdown-timeout
socket-configurator shutdown-executor heartbeat-executor topology-recovery-executor
observation-collector credentials-refresh-service recovery-delay-handler nio-params
channel-should-check-rpc-response-type? work-pool-timeout error-on-write-listener
topology-recovery-filter connection-recovery-triggering-condition recovered-queue-name-supplier
traffic-listener use-nio? use-blocking-io? channel-rpc-timeout max-inbound-message-body-size
connection-name update-client-properties topology-recovery-retry-handler
update-connection-factory]
:or {requested-heartbeat ConnectionFactory/DEFAULT_HEARTBEAT
connection-timeout ConnectionFactory/DEFAULT_CONNECTION_TIMEOUT
requested-channel-max ConnectionFactory/DEFAULT_CHANNEL_MAX
Expand All @@ -340,14 +347,63 @@
(.useSslProtocol cf))
(doto cf
(.setClientProperties final-properties)
(.setUsername username)
(.setPassword password)
(.setVirtualHost vhost)
(.setHost host)
(.setPort port)
(.setRequestedHeartbeat requested-heartbeat)
(.setConnectionTimeout connection-timeout)
(.setRequestedChannelMax requested-channel-max))
(if credentials-provider
(.setCredentialsProvider cf credentials-provider)
(doto cf
(.setUsername username)
(.setPassword password)))
(when metrics-collector
(.setMetricsCollector cf metrics-collector))
(when requested-frame-max
(.setRequestedFrameMax cf requested-frame-max))
(when handshake-timeout
(.setHandshakeTimeout cf handshake-timeout))
(when shutdown-timeout
(.setShutdownTimeout cf shutdown-timeout))
(when socket-configurator
(.setSocketConfigurator cf socket-configurator))
(when shutdown-executor
(.setShutdownExecutor cf shutdown-executor))
(when heartbeat-executor
(.setHeartbeatExecutor cf heartbeat-executor))
(when topology-recovery-executor
(.setTopologyRecoveryExecutor cf topology-recovery-executor))
(when topology-recovery-filter
(.setTopologyRecoveryFilter cf topology-recovery-filter))
(when observation-collector
(.setObservationCollector cf observation-collector))
(when credentials-refresh-service
(.setCredentialsRefreshService cf credentials-refresh-service))
(when recovery-delay-handler
(.setRecoveryDelayHandler cf recovery-delay-handler))
(when use-nio?
(.useNio cf))
(when nio-params
(.setNioParams cf nio-params))
(when use-blocking-io?
(.useBlockingIo cf))
(when channel-rpc-timeout
(.setChannelRpcTimeout cf channel-rpc-timeout))
(when max-inbound-message-body-size
(.setMaxInboundMessageBodySize cf max-inbound-message-body-size))
(when (some? channel-should-check-rpc-response-type?)
(.setChannelShouldCheckRpcResponseType cf channel-should-check-rpc-response-type?))
(when work-pool-timeout
(.setWorkPoolTimeout cf work-pool-timeout))
(when error-on-write-listener
(.setErrorOnWriteListener cf error-on-write-listener))
(when connection-recovery-triggering-condition
(.setConnectionRecoveryTriggeringCondition cf connection-recovery-triggering-condition))
(when recovered-queue-name-supplier
(.setRecoveredQueueNameSupplier cf recovered-queue-name-supplier))
(when traffic-listener
(.setTrafficListener cf traffic-listener))
(when sasl-config
(.setSaslConfig cf sasl-config))
(when ssl-context
Expand All @@ -359,9 +415,13 @@
(.setThreadFactory cf ^ThreadFactory thread-factory))
(when topology-recovery-retry-handler
(.setTopologyRecoveryRetryHandler cf ^RetryHandler topology-recovery-retry-handler))
(when ssl-context-factory
(.setSslContextFactory cf ssl-context-factory))
(when socket-factory
(.setSocketFactory cf ^SocketFactory socket-factory))
(if exception-handler
(.setExceptionHandler cf ^ExceptionHandler exception-handler)
(.setExceptionHandler cf (ForgivingExceptionHandler.)))
(when update-connection-factory
(update-connection-factory cf))
cf))

0 comments on commit 21efe4a

Please sign in to comment.