Skip to content

Instantly share code, notes, and snippets.

@michaelklishin michaelklishin/protocols.clj Secret
Created Jul 24, 2011

Embed
What would you like to do?
Exception in thread "main" java.lang.IllegalArgumentException: interface com.rabbitmq.client.Connection is not a protocol (core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.load(Compiler.java:5857)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4519.invoke(core.clj:4915)
at clojure.core$load.doInvoke(core.clj:4914)
(ns leporidae.protocols
(:import (com.rabbitmq.client ConnectionFactory Connection)))
;;
;; Protocols
;;
(defprotocol Closeable
(close [c] "Closes given entity"))
(extend-type Closeable
com.rabbitmq.client.Connection
(close [this] (.close this)))
(extend-type Closeable
com.rabbitmq.client.Channel
(close [this] (.close this)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.