 
 (defmethod decode :clojure [message]
   "Turn a string into a clojure data structure"
-  (load-string (.getText message)))
+  (core/decode (.getText message)))
 
 (defmethod decode :json [message]
   "Turn a string into a json data structure"
-  (json/read-json (.getText message)))
+  (core/decode (.getText message) :json))
 
 (defmethod decode :text [message]
   "Treats the message payload as a raw string. No decoding is done."

(defn ^{:private true} get-encoding [^javax.jms.Message msg]
  (keyword (.getStringProperty msg encoding-header-name)))


;; Encode

(defmulti encode (fn [_ _ {encoding :encoding}] (or encoding :clojure)))

;; 02110-1301 USA, or see the FSF site: http://www.fsf.org.

(ns immutant.messaging.codecs
  (:require [immutant.codecs :as core]))

(def encoding-header-name "__ContentEncoding__")

