(connect {:keys [protocol host port connection-ttl version engine auth
request-fn validate-after-inactivity threads default-per-route
insecure? connection-timeout socket-timeout]
:or {engine :elasticsearch
version 7
insecure? false
validate-after-inactivity default-validate-after-inactivity
protocol :http
default-per-route default-per-route
connection-ttl default-connection-ttl
request-fn client/request
threads default-threads
connection-timeout default-connection-timeout}})Inputs: [{:keys [protocol host port connection-ttl version engine auth request-fn validate-after-inactivity threads default-per-route insecure? connection-timeout socket-timeout], :or {engine :elasticsearch, version 7, insecure? false, validate-after-inactivity default-validate-after-inactivity, protocol :http, default-per-route default-per-route, connection-ttl default-connection-ttl, request-fn client/request, threads default-threads, connection-timeout default-connection-timeout}} :- ConnectParams] Returns: ESConn
Instantiate an ES conn from ConnectParams props.
To intercept all ES HTTP requests, set :request-fn
to function with the same interface as the 1-argument
arity of clj-http.client/request.
Connection pool options:
Request timeout options (applied to every request):
Inputs: [{:keys [protocol host port connection-ttl version engine auth request-fn validate-after-inactivity threads default-per-route insecure? connection-timeout socket-timeout], :or {engine :elasticsearch, version 7, insecure? false, validate-after-inactivity default-validate-after-inactivity, protocol :http, default-per-route default-per-route, connection-ttl default-connection-ttl, request-fn client/request, threads default-threads, connection-timeout default-connection-timeout}} :- ConnectParams]
Returns: ESConn
Instantiate an ES conn from ConnectParams props.
To intercept all ES HTTP requests, set :request-fn
to function with the same interface as the 1-argument
arity of `clj-http.client/request`.
Connection pool options:
- :connection-ttl - how long connections live in the pool in seconds (default: 60)
- :validate-after-inactivity - check idle connections before reuse, in ms (default: 5000)
Prevents NoHttpResponseException from stale connections closed server-side.
- :threads - max total connections in pool (default: 100)
- :default-per-route - max connections per route (default: 100)
- :insecure? - allow insecure SSL connections, e.g. self-signed certs (default: false)
Request timeout options (applied to every request):
- :connection-timeout - time to establish TCP connection in ms (default: 10000)
- :socket-timeout - time to wait for data in ms (default: none, for long-running operations)(make-connection-manager {:keys [connection-ttl validate-after-inactivity]
:as opts})Create a reusable connection manager with the given options.
Options:
Create a reusable connection manager with the given options. Options: - :connection-ttl - how long connections live in the pool in seconds - :threads - max total connections - :default-per-route - max connections per route - :insecure? - allow insecure SSL (self-signed certs) - :validate-after-inactivity - check idle connections before reuse (in ms) Helps prevent NoHttpResponseException from stale connections.
(make-http-opts conn)(make-http-opts conn opts)(make-http-opts conn opts query-params-keys)(make-http-opts {:keys [cm auth timeouts]}
opts
query-params-keys
form-params
body)Inputs: ([{:keys [cm auth timeouts]} :- (s/maybe ESConn) opts :- (s/pred map?) query-params-keys :- (s/maybe (s/pred coll?)) form-params :- (s/maybe (s/pred map?)) body :- s/Any] [conn opts query-params-keys] [conn opts] [conn]) Returns: (s/pred map?)
Inputs: ([{:keys [cm auth timeouts]} :- (s/maybe ESConn) opts :- (s/pred map?) query-params-keys :- (s/maybe (s/pred coll?)) form-params :- (s/maybe (s/pred map?)) body :- s/Any] [conn opts query-params-keys] [conn opts] [conn])
Returns: (s/pred map?)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |