Skip to content

Commit

Permalink
Re-work how ExceptionHandler is set
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jul 26, 2015
1 parent f4ace08 commit 809d644
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/clojure/langohr/core.clj
Expand Up @@ -43,7 +43,7 @@
ConnectionFactory ShutdownListener BlockedListener
Consumer TopologyRecoveryException
ExceptionHandler Recoverable RecoveryListener DefaultSaslConfig]
[com.rabbitmq.client.impl DefaultExceptionHandler AMQConnection]
[com.rabbitmq.client.impl ForgivingExceptionHandler AMQConnection]
[com.rabbitmq.client.impl.recovery AutorecoveringConnection QueueRecoveryListener]
clojure.lang.IFn
java.util.concurrent.ThreadFactory)
Expand Down Expand Up @@ -238,7 +238,7 @@
handle-connection-recovery-exception-fn
handle-channel-recovery-exception-fn
handle-topology-recovery-exception-fn]}]
(proxy [DefaultExceptionHandler] []
(proxy [ForgivingExceptionHandler] []
(handleUnexpectedConnectionDriverException [^Connection conn ^Throwable t]
(when handle-connection-exception-fn
(handle-connection-exception-fn conn t)))
Expand Down Expand Up @@ -339,7 +339,8 @@
(.useSslProtocol cf ^javax.net.ssl.SSLContext ssl-context))
(when thread-factory
(.setThreadFactory cf ^ThreadFactory thread-factory))
(when exception-handler
(.setExceptionHandler cf ^ExceptionHandler exception-handler))
(if exception-handler
(.setExceptionHandler cf ^ExceptionHandler exception-handler)
(.setExceptionHandler cf (ForgivingExceptionHandler.)))
cf))

0 comments on commit 809d644

Please sign in to comment.