Say I have a RabbitMQ queue and I want to write clojure code to handle messages in a queue

How or how can I call clojure code to handle tasks in the RabbitMQ queue?

Should I write a demon or what?

I know that Java code takes a long time to start over, so I hope there is a way to write a long process for my clojure code to run against.

I completely lost that clojure container will be launched, for example. it would be a demon, if so, how to write a clojure daemon?

+3
source share
2 answers

Your question is a little generalized, so let me break it down:

  • You have a RabbitMQ queue and want to consume messages from Clojure
  • .

, ( RabbitMQ clojure).

clojure:

clojure, :

(defn -main [& args]
  "your code")

. - clojure. Leiningen , project.clj, uberjar, .

$ lein compile
$ lein uberjar
$ java -jar my-uber-jar.jar

. - - :

$ java -jar my-uber-jar.jar &

, , .

+5

All Articles