-
Fix scroll-id larger than 4K causing
too_long_frame_exception
#45 -
bump dependencies: clojure, core.async, commons, elasticsearch-rest-client to 7.2
- bump dependencies: clojure, elasticsearch-rest-client to 7.1
- Fix scroll_id issue in scroll-chan. See #44
- add
qbits.spandex.utils/escape-query-string
function
- bump dependencies
-
bump dependencies
-
kill deprecated request decompression param
- fix bug in scroll-chan where request-chan and scroll chan output
chan would be mixed up if the user passed a :ch option. scroll-chan
output chan is now called
:output-ch
, same asbulk-chan
.
- bump ES dep to 6.2.1
- make response consumer factory configurable in sync requests and refactor related code a bit
- bump qbits.commons
- bump ES dep to 6.2.1
- bump clojure to 1.9 final
- bump core.async to latest
- properly url-encode url fragments when passing url as data
- update deps: core.async, clojure, es rest client, cheshire
- properly decompress body when returned as gzipped content. thx to @ahjones for the report and first patch
- bump ES dep to 5.5.0
-
Add chan->seq utility function
-
bump ES dep to 5.5.0
- fix bug with scroll_id parameter with ES 5.4 (they removed a backward compat with raw param in body, body is assumed to be JSON.
-
:url
key in request-maps is not protocolized, as a result all request functions now accept the request:url
key as String or Keyword or Sequential (potentially 2d), the same wayqbits.spandex.utils/url
used to work in that case.you can now write:
(request client {:url "/foo" ...})
(request client {:url :foo ...})
(request client {:url [:foo :bar "baz"] ...})
(request client {:url [:foo [:bar :baz "prout"]] ...})
-
depreciated
qbits.spandex.utils/url
. It now lives underqbits.spandex.url/encode
, there's an alias so it should be backward compatible. -
bump cheshire and elasticsearch client dependency
- specify utf-8 charset in content-type header
- bump clj + core.async deps
-
proper content-type defaults to prevent warnings with ES 5.3+
-
request-chan now accepts a
:ch
option which defaults to the originalpromise-chan
returned by the function.
- Swap use of Throwable to Exception (thx @axel-angel)
- bulk-chan: if the user closes :input-ch to signal the need to end the process all pending messages will be processed and upon completion :output-ch will be closed (it wasn't the case before)
- Bump clj to 1.9a16
- Bump ES client dependency to 5.3.1
- Prefix _bulk endpoint with leading slash
- Bump ES client dependency to 5.3.0
- Bump clj to 1.9a15
- Bump core.async to 0.3.442
-
Bump dependencies (cheshire, codox)
-
make
scroll-chan
2.x- compatible
- Bump ES client dependency to 5.2.2
- Bump core.async dependency to 0.3.441
- Bump core.async dependency to 0.3.436
- Bump core.async dependency to 0.3.426
- Bump ES client dependency to 5.2.1
ResponseExceptions are now returned as ex-info instances wrapping the real response decoded as clojure map.
That means you can just call ex-data on it and get to it that way
(try (s/request client {:url "/a/a/a/a/a"})
(catch clojure.lang.ExceptionInfo ex
(prn (ex-data ex))))
=> #qbits.spandex.Response{
:type :qbits.spandex/response-exception
:body "No handler found for uri [/a/a/a/a/a] and method [GET]"
:status 400
:headers {"Content-Type" "text/plain; charset=UTF-8", "Content-Length" "54"}
:hosts #object[org.apache.http.HttpHost 0x968acb8 "http://localhost:9200"]}
You can overwrite this behavior in a few ways:
-
the default
:exception-handler
(akadefault-exception-handler
) callsExceptionDecoder/decode-exception
which is a protocol based function, when the result is a throwable it will rethrow otherwise it returns the value. That means you can just extend it if you prefer to haveqbits.spandex.Response
as a value. Doing so will also be valid for async request triggering functions (minus the throwing).something like the following
(extend-protocol ExceptionDecoder ResponseException (decode-exception [x] (response-ex->response x)))
-
Or you can pass your own
:exception-handler
to all request triggering functions to do whatever you'd like and bypass the protocol altogether.
- Bump es client dependencies
- better spec coverage for client options
- qbits.spandex.utils/url now generates urls with a leading slash
- extended the http-client/request options, see qbits.spandex/client
- removed *-callback options (they are superseeded by the above)