     (taoensso.timbre/info "Stopping Netty TCP Sockets")
     (try 
       (when-let [rs @resources]
-        (let [{:keys [shutdown-fn shutdown-ch parsed-ch]} rs] 
-          (shutdown-fn)
-          (close! parsed-ch)
-          (close! shutdown-ch))
+        (let [{:keys [shutdown-fn shutdown-ch]} rs] 
+          (close! shutdown-ch)
+          (shutdown-fn))
         (reset! resources nil)) 
       (catch Exception e (timbre/fatal e)))
     (assoc component :bind-addr nil :external-addr nil 

(defmethod extensions/open-peer-site NettyTcpSockets
  [messenger assigned]
  (let [buf-recv-ch (chan 10000)
        parsed-ch (chan (clojure.core.async/dropping-buffer 10000))
        inbound-ch (:inbound-ch (:messenger-buffer messenger))
        release-ch (:release-ch messenger)
        retry-ch (:retry-ch messenger)

                (.handler (client-channel-initializer (new-client-handler))))]
        (.channel ^ChannelFuture (.connect b host port))))))

(defn app [daemon messenger buf-recv-ch inbound-ch release-ch retry-ch shutdown-ch]
  (go-loop []
          (let [[buf ch] (alts!! [buf-recv-ch shutdown-ch])]
            (when buf 
              (try 
                (let [msg (protocol/read-buf (:decompress-f messenger) buf)]
                  ;; undo retain added in server handler
                  (.release ^ByteBuf buf)
                  (let [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)))))

(defrecord NettyTcpSockets [peer-group]
  component/Lifecycle
