                                     ))]
     (.close browser)
     (.close s)
+    (.close c)
     converted-messages))
 
 (defn browse-queue-messages [connection-info queue-info]

                                   )
    :else (throw (IOException. (str "Not supported message class!" (.getClass msg))))))

(defn get-type[v]
  (if (nil? v)
    :string
    (condp instance? v
        String :string
        Long :long
        Integer :int
        Short :short
        Double :double
        Float :float
        Boolean :boolean
        :string
      )))

(defn convert-message [^Message msg]

       (take-while some?)))

(defn consume-queue [connection-info queue-info]
  (let [^Connection c (get-connection connection-info)
        ^Session s (get-session c Session/CLIENT_ACKNOWLEDGE)
        ^Queue q (get-queue s queue-info)
        ^MessageConsumer consumer (.createConsumer s q)
        messages (get-all consumer)
        converted-messages (doall (map convert-message messages))]
    (.close consumer)
    (.close s)
    (.close c)
    (doall converted-messages)))

(defn browse-queue [connection-info queue-info]
  (let [^Connection c (get-connection connection-info)
        ^Session s (get-session c)
        ^Queue q (get-queue s queue-info)
        ^QueueBrowser browser (.createBrowser s q)
        ^Enumeration msgs-e (.getEnumeration browser)
