0

I use riemann and now I write my riemann.config.

I want to use clj-http post all events from riemann stream to my web server. But I don't know how to import clj-http from riemann.jar.

I code (:use clj-http.client) or (:require [clj-http.client :as client]) in riemann.config but got error:

java.lang.ClassNotFoundException: clj-http.client

Could anyone help me ?

keroro520
  • 459
  • 4
  • 12
  • I had similar question some time ago http://stackoverflow.com/questions/27766730/riemann-io-add-jar-to-classpath – Viktor K. Jul 01 '15 at 06:45

1 Answers1

1

I did something similar few months ago and this was working for me. I was using http-kit :

(require '[org.httpkit.client :as http])

Since both http-kit and cli-http are available in riemann ( see https://github.com/aphyr/riemann/blob/master/project.clj ) You should be able to require cli-http the same way :

(require '[clj-http.client :as client])

Problem in your configuration is that you are using (:use ... an (:require .... which is supposed to be used within the namespace declaration. Since riemann.config doesn't contain namespace declaration you can't use these forms. When calling

(:use clj-http.client)

you get ClassNotFoundException because clojure is trying to invoke function :use on clj-http.client , which can't be found. Outside the namespace declaration :use is just a standard keyword with no special meaning.

Viktor K.
  • 2,670
  • 2
  • 19
  • 30