     (handlerAdded [ctx]
       (timbre/info "Handler added"))
     (handlerRemoved [ctx]
-       (timbre/info "Handler removed"))
+      (timbre/info "Handler removed"))
     (exceptionCaught [context cause]
       (.printStackTrace cause)
       (.close context))))

        (.channel ^ChannelFuture (.connect b host port))))))

(defn app [daemon parsed-ch inbound-ch release-ch retry-ch]
    (go-loop []
             (try (let [msg (<!! parsed-ch)
                        t ^byte (:type msg)]
                    (cond (= t protocol/messages-type-id) 
                          (doseq [message (:messages msg)]
                            (>!! inbound-ch message))

                          (= t protocol/ack-type-id)
                          (acker/ack-message daemon
                                             (:id msg)
                                             (:completion-id msg)
                                             (:ack-val msg))

                          (= t protocol/completion-type-id)
                          (>!! release-ch (:id msg))

                          (= t protocol/retry-type-id)
                          (>!! retry-ch (:id msg))

                          :else
                          (throw (ex-info "Unexpected message received from Netty" {:message msg}))))
                  (catch Exception e
                    (taoensso.timbre/error e)
                    (throw e)))
             (recur)))

(defn buf-recv-loop [buf-recv-ch parsed-ch]
  (go-loop []
           (let [buf (<!! buf-recv-ch)]
             (try 
               (let [decompressed (protocol/read-buf buf)]
                 (>!! parsed-ch decompressed)
                 ; undo retain added in server handler
                 (.release ^ByteBuf buf))
               (catch Throwable t
                 (timbre/fatal t "Exception in recv loop.")))
                 (recur))))

(defrecord NettyTcpSockets [peer-group]
  component/Lifecycle

(defmethod extensions/send-messages NettyTcpSockets
  [messenger event ^Channel peer-link messages]
  (.writeAndFlush peer-link 
                  ^ByteBuf (protocol/build-messages-msg-buf (:compress-f messenger) messages) 
                  (.voidPromise ^Channel peer-link)))

(defmethod extensions/internal-ack-message NettyTcpSockets
