 (def id (java.util.UUID/randomUUID))
 
 (def coord-opts
-  {:hornetq/mode :vm
+  {:hornetq/mode :vm ;; Run HornetQ inside the VM for convenience
    :hornetq/server? true
    :hornetq.server/type :vm
    :zookeeper/address "127.0.0.1:2185"
-   :zookeeper/server? true
+   :zookeeper/server? true ;; Run ZK inside the VM for convenience
    :zookeeper.server/port 2185
    :onyx/id id
    :onyx.coordinator/revoke-delay 5000})


(defn question [segment]
  {:word (question-impl (:word segment))})

(def workflow
  {:input

   :zookeeper/address "127.0.0.1:2185"
   :onyx/id id})

;; Connect to the coordinator. Also boots up in the in-memory services.
(def conn (onyx.api/connect :memory coord-opts))

;; Start the worker peers.
(def v-peers (onyx.api/start-peers conn 1 peer-opts))

(onyx.api/submit-job conn {:catalog catalog :workflow workflow})
