Created
January 16, 2015 12:34
-
-
Save ChrisBlom/fb8e4848cead57338586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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