Commit graph

148 commits

Author SHA1 Message Date
Preben Ingvaldsen
c6ce8dd301 (TK-108) Add a persistent sync Java client
Add a PersistentSyncHttpClient class, which is a wrapper around
CloseableHttpAsyncClient and allows multiple requests to be made
with a persistent synchronous client.
2014-11-10 10:08:13 -08:00
Preben Ingvaldsen
018fe70153 (TK-108) Add a persistent async Java client
Add a new class, PersistentAsyncHttpClient, that is a wrapped
CloseableHttpAsyncClient that is persistent.
2014-11-07 13:29:17 -08:00
Preben Ingvaldsen
972de1e9e9 (TK-108) Separate Java RequestOptions class
Separate the Java RequestOptions class into two new classes:
RequestOptions, which contains options related to the request,
and ClientOptions, which contains options related to the client.
Both are now required when calling the request methods in
AsyncHttpClient and SyncHttpClient.
2014-11-07 10:44:20 -08:00
Jenkins CI
6ec9d10867 lein-release plugin: bumped version from 0.3.1 to 0.3.2-SNAPSHOT for next development cycle 2014-10-22 16:22:43 -07:00
Jenkins CI
b9628bce0d lein-release plugin: preparing 0.3.1 release 2014-10-22 16:22:23 -07:00
Preben Ingvaldsen
631f26061f Update CHANGELOG for 0.3.1 release. 2014-10-22 16:21:09 -07:00
Kevin Corcoran
fa852c9b7c Merge pull request #21 from camlow325/bug/master/TK-101-clients-leaked-on-fail
(TK-101) Move closing of http clients to a separate thread
2014-10-21 15:36:35 -07:00
Jeremy Barlow
0ad887a589 Merge pull request #22 from cprice404/bug/master/TK-97-bug-in-tests-on-oraclejdk
(TK-97) Fix bug in tests on Oracle JDKs
2014-10-21 15:18:28 -07:00
Chris Price
b70ac50b17 (TK-97) Fix bug in tests on Oracle JDKs
The test code related to the configurable SSL protocols was
written using some ciphers that are available in OpenJDK, but
are not available by default in Oracle JDK.  This caused the
tests to fail on Oracle JDKs.

This commit changes the test to use some older ciphers that
are available in the Oracle JDK out of the box.
2014-10-21 15:08:15 -07:00
Jenkins CI
f447810c9d lein-release plugin: bumped version from 0.3.0 to 0.3.1-SNAPSHOT for next development cycle 2014-10-21 14:39:55 -07:00
Jenkins CI
dffa48cbc1 lein-release plugin: preparing 0.3.0 release 2014-10-21 14:39:35 -07:00
Preben Ingvaldsen
6815653183 Update CHANGELOG and version for 0.3.0 release 2014-10-21 14:34:26 -07:00
Jeremy Barlow
88fdad7c05 Merge pull request #20 from cprice404/feature/master/TK-97-configurable-ssl-protocols
(TK-97) configurable ssl protocols
2014-10-21 12:15:17 -07:00
Jeremy Barlow
cbeacd1860 (TK-101) Re-throw IOException from AsyncClose/close call
This commit rethrows any `IOException` caught on a closeable close call
made from the `AsyncClose` class.
2014-10-20 22:53:34 -07:00
Jeremy Barlow
f859bd907a (TK-101) Move closing of http clients to a separate thread
This commit moves each close call made on a `CloseableHttpAsyncClient`
from the thread on which the request callback is made over to a
different thread in order to avoid a deadlock.

Previously, the client close call was made in the context of thread from
which the callback was invoked.  The Apache HTTP async client library
makes these calls from one of its i/o reactor threads.  In the case of a
"failed" request, e.g., failure to make the client connection, this call
occurs in the context of the primary i/o reactor thread.  The client
close call does an indefinite join on the primary i/o reactor thread
and, therefore, this call causes a deadlock.  The client never closes
and all resources associated with it - threads, file descriptors, etc. -
remain open until the process is shutdown.

This commit introduces a new class, `AsyncClose`, which manages a small,
fixed size thread pool from which client close calls can be executed.
The `async` Clojure and `JavaClient` APIs were updated to use `AsyncClose`
whenever a client needs to be closed from a callback.
2014-10-20 14:22:56 -07:00
Chris Price
251d859d10 (TK-97) Expose configuration settings for protocols/cipher suites
This commit adds configuration settings for the SSL protocols
and cipher suites, in both the java and clojure clients.  It
also adds a list of default protocols which will be used if
the protocols setting is not explicitly set.
2014-10-17 23:35:05 -07:00
Chris Price
180a4bf78d (TK-97) Switch from .setSSLContext to .setSSLStrategy
Prior to this commit, we were using `HttpAsyncClientBuilder.setSSLContext`
to set up our HTTPS SSL configuration.  That method doesn't provide
a mechanism for specifying a list of acceptable protocols or ciphers.

This commit simply ports the code over to use `.setSSLStrategy`
instead, because it allows a larger number of configuration options.
2014-10-17 20:18:40 -07:00
Chris Price
2d0e45e9f8 (TK-97) DRY up client construction 2014-10-17 20:01:19 -07:00
Chris Price
c2cbb11d5d (TK-97) Update dependencies to latest versions
Update dependencies (trapperkeeper, trapperkeeper-webserver-jetty9,
etc.) to the latest versions and fix tests accordingly.
2014-10-17 19:50:08 -07:00
Jenkins CI
9057fe3333 lein-release plugin: bumped version from 0.2.8 to 0.2.9-SNAPSHOT for next development cycle 2014-10-01 14:33:27 -07:00
Jenkins CI
ca52067a64 lein-release plugin: preparing 0.2.8 release 2014-10-01 14:33:07 -07:00
Chris Price
7bd7aacda2 Merge pull request #19 from camlow325/maint/master/clj-http-client-0.2.8-release
Updated changelog for 0.2.8 release
2014-10-01 14:27:40 -07:00
Jeremy Barlow
82e4885e64 Updated changelog for 0.2.8 release 2014-10-01 14:16:32 -07:00
Chris Price
7043a96295 Merge pull request #18 from camlow325/bug/master/TK-88-errant-client-build
(TK-88) Removed errant build call from JavaClient's createClient()
2014-10-01 13:39:34 -07:00
Jeremy Barlow
8c1d44b984 (TK-88) Removed errant build call from JavaClient's createClient()
This commit removes an unnecessary build() method call made on the
HttpAsyncClientBuilder in JavaClient's createClient() method.
Previously, the presence of this call would cause an extra
CloseableHttpAsyncClient object to be created.  Since close() was never
called on the extra client object, native file descriptor resources were
never freed even after the object fell out of scope.
2014-10-01 13:20:21 -07:00
Jenkins CI
af09a0e97c lein-release plugin: bumped version from 0.2.7 to 0.2.8-SNAPSHOT for next development cycle 2014-09-18 18:36:54 -07:00
Jenkins CI
4ad2cbb976 lein-release plugin: preparing 0.2.7 release 2014-09-18 18:36:33 -07:00
Chris Price
46e9756c64 Update CHANGELOG for 0.2.7 release 2014-09-18 18:34:14 -07:00
Nate Wolfe
7690155ee5 Merge pull request #17 from camlow325/maint/master/PE-6019-encode-request-body-string-per-content-type
(PE-6019) Encode string request body per Content-Type header
2014-09-18 18:27:27 -07:00
Jeremy Barlow
9b39fbd854 (PE-6019) Addressed PR feedback
This commit contains two changes:

* Revert the Pascal-casing of the `Accept-Encoding` header added to
  async.clj

* Use `.toString` method on the `Content-Type` class to handle the
  serialization of the `Content-Type` header value
2014-09-18 17:41:06 -07:00
Jeremy Barlow
f83d7821ad (PE-6019) Encode string request body per Content-Type header
This commit encodes a request body string per the content of the
Content-Type header.  In the event that no charset is specified in the
Content-Type header, the charset is set to UTF-8.  Previously, the
request body string was always encoded to ISO-8859-1 and was not
necessarily in sync with the value of the Content-Type header.
2014-09-18 17:02:00 -07:00
Jenkins User
611218fb23 lein-release plugin: bumped version from 0.2.6 to 0.2.7-SNAPSHOT for next development cycle 2014-08-27 13:30:26 -07:00
Jenkins User
cfd9505016 lein-release plugin: preparing 0.2.6 release 2014-08-27 13:30:02 -07:00
Preben Ingvaldsen
195c394e5e Update CHANGELOG for 0.2.6 release 2014-08-27 13:27:10 -07:00
Chris Price
cbb3984368 Merge pull request #14 from fpringvaldsen/PE-5623-follow-redirects
(PE-5623) Add force-redirects option
2014-08-27 10:38:07 -07:00
Preben Ingvaldsen
cf51ff731a Address PR comments
Address PR comments by changing uses of `if` without an else
clause to `when`
2014-08-26 16:55:14 -07:00
Preben Ingvaldsen
73292ab690 (PE-5623) Add followRedirects option to Java client
Add followRedirects option to Java client, which functions
the same as the :follow-redirects option in the clj client.
2014-08-26 16:49:36 -07:00
Preben Ingvaldsen
06636b461e (PE-5623) Add :follow-redirects option clj clients
Add a :follow-redirects option to the clj clients which, when
set to false, will prevent the client from following a redirect.
2014-08-26 16:36:47 -07:00
Preben Ingvaldsen
4bd7d25403 (PE-5623) Add forceRedirects option to Java client
Add a forceRedirects option to the Java client that allows it to
follow redirects on POST and PUT requests.
2014-08-25 11:57:39 -07:00
Preben Ingvaldsen
d9f2f1d0f3 (PE-5623) Add :force-redirects to clj client
Add a :force-redirects option to the clojure client that will
relax the redirect restrictions put on the client for a POST
or PUT method.
2014-08-25 11:15:22 -07:00
Jenkins User
f61a49d50a lein-release plugin: bumped version from 0.2.5 to 0.2.6-SNAPSHOT for next development cycle 2014-08-22 15:37:56 -07:00
Jenkins User
63ea9fbea9 lein-release plugin: preparing 0.2.5 release 2014-08-22 15:37:33 -07:00
Chris Price
cdf9e2a4b3 CHANGELOG for 0.2.5 2014-08-22 15:35:02 -07:00
Chris Price
f012782c82 Merge pull request #13 from fpringvaldsen/Request-Options-String-Constructor
Add RequestOptions constructor with string
2014-08-22 15:29:57 -07:00
Preben Ingvaldsen
9e37eeeabe Add RequestOptions constructor with string
Add a RequestOptions constructor that takes a string instead
of a URI. Modify the basic-test function to use the string
constructor.
2014-08-22 14:46:06 -07:00
Jenkins User
2ac2e11ab5 lein-release plugin: bumped version from 0.2.4 to 0.2.5-SNAPSHOT for next development cycle 2014-08-22 08:08:18 -07:00
Jenkins User
350de616f2 lein-release plugin: preparing 0.2.4 release 2014-08-22 08:07:55 -07:00
Chris Price
0e37f0ea5b Update CHANGELOG for 0.2.4 release 2014-08-22 08:05:38 -07:00
Jeremy Barlow
2a67e0b4b8 Merge pull request #12 from cprice404/bug/master/PE-5567-npe-if-no-charset
(PE-5567) Fix bug if content-type header has no charset
2014-08-22 08:04:47 -07:00
Chris Price
88a6e83d48 (PE-5567) Fix bug if content-type header has no charset
Prior to this commit, the Java client API would throw an NPE if
it got a response from a server where the Content-Type header
did not include a charset.
2014-08-22 08:03:36 -07:00