Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce http2 #119

Merged
merged 9 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ checkouts/*
.nrepl-*

.clj-kondo/*
.lsp/*
.lsp/*
.calva/output-window/output.calva-repl
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.8"
services:
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: 'rabbitmq'
ports:
- 5672:5672
- 15672:15672
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
networks:
- rabbitmq_go_net

networks:
rabbitmq_go_net:
driver: bridge
7 changes: 4 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[com.rabbitmq/amqp-client "5.18.0"]
[clojurewerkz/support "1.1.0" :exclusions [com.google.guava/guava]]
[clj-http "3.12.3"]
[cheshire "5.10.1"]]
[hato "0.9.0"]
[cheshire "5.11.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"]]}
Expand All @@ -18,7 +19,7 @@
:source-uri "https://github.com/michaelklishin/langohr/blob/v{version}/{filepath}#L{line}"}}}
:source-paths ["src/clojure"]
:java-source-paths ["src/java"]
:javac-options ["-target" "1.8" "-source" "1.8"]
:javac-options ["-target" "11" "-source" "1.8"]
:url "https://clojurerabbitmq.info"
:repositories {"sonatype" {:url "https://oss.sonatype.org/content/repositories/releases"
:snapshots false
Expand All @@ -42,7 +43,7 @@
:time-consuming :time-consuming
:performance :performance
:tls :tls
:ci (fn [m] (not (:tls m)))}
:ci (complement :tls)}
:mailing-list {:name "clojure-rabbitmq"
:archive "https://groups.google.com/group/clojure-rabbitmq"
:post "[email protected]"})
58 changes: 26 additions & 32 deletions src/clojure/langohr/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -244,44 +244,40 @@
(defn exception-handler
[{:keys [handle-connection-exception-fn
handle-return-listener-exception-fn
handle-flow-listener-exception-fn
;handle-flow-listener-exception-fn
michaelklishin marked this conversation as resolved.
Show resolved Hide resolved
handle-confirm-listener-exception-fn
handle-blocked-listener-exception-fn
handle-consumer-exception-fn
handle-connection-recovery-exception-fn
handle-channel-recovery-exception-fn
handle-topology-recovery-exception-fn]}]
(proxy [ForgivingExceptionHandler] []
(handleUnexpectedConnectionDriverException [^Connection conn ^Throwable t]
(reify ExceptionHandler
(handleUnexpectedConnectionDriverException [_ conn throwable]
(when handle-connection-exception-fn
(handle-connection-exception-fn conn t)))
(handleReturnListenerException [^Channel ch ^Throwable t]
(handle-connection-exception-fn conn throwable)))
(handleReturnListenerException [_ channel throwable]
(when handle-return-listener-exception-fn
(handle-return-listener-exception-fn ch t)))
(handleFlowListenerException [^Channel ch ^Throwable t]
(when handle-flow-listener-exception-fn
(handle-flow-listener-exception-fn ch t)))
(handleConfirmListenerException [^Channel ch ^Throwable t]
(handle-return-listener-exception-fn channel throwable)))
(handleConfirmListenerException [_ channel throwable]
(when handle-confirm-listener-exception-fn
(handle-confirm-listener-exception-fn ch t)))
(handleBlockedListenerException [^Connection conn ^Throwable t]
(handle-confirm-listener-exception-fn channel throwable)))
(handleBlockedListenerException [_ conn throwable]
(when handle-blocked-listener-exception-fn
(handle-blocked-listener-exception-fn conn t)))
(handleConsumerException [^Channel ch ^Throwable t
^Consumer consumer ^String consumer-tag
^String method-name]
(handle-blocked-listener-exception-fn conn throwable)))
(handleConsumerException [_ channel throwable consumer consumer-tag method-name]
(when handle-consumer-exception-fn
(handle-consumer-exception-fn ch t consumer consumer-tag method-name)))
(handleConnectionRecoveryException [^Connection conn ^Throwable t]
(handle-consumer-exception-fn channel throwable consumer consumer-tag method-name)))
(handleConnectionRecoveryException [_ conn throwable]
(when handle-connection-recovery-exception-fn
(handle-connection-recovery-exception-fn conn t)))
(handleChannelRecoveryException [^Channel ch ^Throwable t]
(handle-connection-recovery-exception-fn conn throwable)))
(handleChannelRecoveryException [_ channel throwable]
(when handle-channel-recovery-exception-fn
(handle-channel-recovery-exception-fn ch t)))
(handleTopologyRecoveryException [^Connection conn ^Channel ch
^TopologyRecoveryException t]
(handle-channel-recovery-exception-fn channel throwable)))
(handleTopologyRecoveryException [_ conn channel tre] ;; TopologyRecoveryException
(when handle-topology-recovery-exception-fn
(handle-topology-recovery-exception-fn conn ch t)))))
(handle-topology-recovery-exception-fn conn channel tre)))
)
)

;;
;; Implementation
Expand All @@ -298,11 +294,10 @@

(defn- platform-string
[]
(let []
(format "Clojure %s on %s %s"
(clojure-version)
(System/getProperty "java.vm.name")
(System/getProperty "java.version"))))
(format "Clojure %s on %s %s"
(clojure-version)
(System/getProperty "java.vm.name")
(System/getProperty "java.version")))

(def ^{:private true}
client-properties {"product" "Langohr"
Expand Down Expand Up @@ -353,9 +348,8 @@
(when sasl-config
(.setSaslConfig cf sasl-config))
(when ssl-context
(do
(.useSslProtocol cf ^javax.net.ssl.SSLContext ssl-context)
(.setPort cf final-port)))
(.useSslProtocol cf ^javax.net.ssl.SSLContext ssl-context)
(.setPort cf final-port))
(when verify-hostname
(.enableHostnameVerification cf))
(when thread-factory
Expand Down
Loading