 
 (defn match-msg
   [server ^HydraMsg msg]
-  (let [id (.id msg)]
+  (let [id (.id msg)
+        routing-id (.routingId msg)]
     (println (= id HydraMsg/HELLO))
     (cond
-     (= id HydraMsg/HELLO)    (hello    server)
+     (= id HydraMsg/HELLO)    (hello    server routing-id)
      (= id HydraMsg/GET_TAGS) (get-tags server)
      (= id HydraMsg/GET_TAG)  (get-tag  server (.tag msg))
 


(defrecord Server [socket state]
  HydraServer
  (hello [this]
    ;; (next-state state :start :connected)
    (let [response (HydraMsg. HydraMsg/HELLO_OK)]
      (get-latest-post response)
      (.send response socket)
      (.destroy response)
      ))

  (get-tags [this]
    (ensure-state state :connected)



(defprotocol HydraServer
  (hello    [this routing-id])
  (get-tags [this])
  (get-tag  [this tag])
  (get-post [this post-id])
