             [langohr.channel :as lch]
             [langohr.queue :as lq]
             [langohr.consumers :as lc]
-            [langohr.basic :as lb]))
+            [langohr.basic :as lb]
+            [langohr.exchange  :as le]))
 
 (def exchange-name
   "The name of the queue exchange to use to retrieve messages"
-  (cfg/config-value :indexer-queue-exchange ""))
+  (cfg/config-value :indexer-queue-exchange "indexer.exchange"))
 
 (def queue-name
   "The name of the queue to use to retrieve messages"

  ;; prevents this.
  (lb/qos ch 1)
  (lq/declare ch queue-name {:exclusive false :auto-delete false})
  ;(lq/bind ch queue-name exchange-name)
  (lc/subscribe ch queue-name message-handler {:auto-ack false}))

(defn create-queue-channels
  "Creates channels for the indexing queue"
  [num-channels]
  (let [conn (rmq/connect)]
    (for [n num-channels]
      (lch/open conn))))

(defrecord MessageConsumer
  [

(comment
  (let [conn (rmq/connect)
        ch (lch/open conn)]
    (lb/publish ch exchange-name queue-name "Hi!" {:routing-key queue-name :content-type "text/plain" :type "index-concept"}))


  )
