Skip to content

Instantly share code, notes, and snippets.

@ChrisBlom
Created January 16, 2015 12:34
Show Gist options
  • Save ChrisBlom/fb8e4848cead57338586 to your computer and use it in GitHub Desktop.
Save ChrisBlom/fb8e4848cead57338586 to your computer and use it in GitHub Desktop.
(defn non-caching-riemann-client
[{:keys [host port] :as riemann-config}]
(assert host)
(assert port)
(let [c (riemann.client/tcp-client :host host :port port)]
;; disable dns caching
;; If we let riemann cache dns lookups, it can't reconnect to the riemann server after that restarts
(-> c
.transport
.transport
.cacheDns
(.set false))
;; a disconnect is needed to make these changes effective
(try (riemann/reconnect-client c)
(catch java.io.IOException e nil))
c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment