   [^ChannelGroup channel-group handler]
   (proxy [ChannelInboundHandlerAdapter] []
     (channelActive [ctx]
-      (.add channel-group (.channel ctx)))
+      (.add channel-group (.channel ^ChannelHandlerContext ctx)))
     (channelRead [^ChannelHandlerContext ctx ^Object message]
       (try
         (handler ctx message)


(defn add-failed-check 
  "Check if the message failed to send"
  [f connection buf]
  (.addListener f (reify GenericFutureListener
                    (operationComplete [_ _]
                      (when-not (.isSuccess f)

           (catch Throwable e
             (timbre/fatal e))))))

(defn established? [^Channel channel]
  (and channel (.isActive channel)))

(defn create-client [client-group host port]
