Skip to content

Remote repo configuration version 2.8.1 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 60 commits into
base: remote-repo-configuration
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e8f5d36
Upgrade netty 4.1.29
slandelle Aug 27, 2018
4d03ad6
Fix EchoHandler missing response ContentLength
slandelle Aug 27, 2018
a6d1cd2
Fix chunked request body handling with HTTPS proxy, close #1571
slandelle Aug 27, 2018
a3b1454
Fix Response#hasResponseBody javadoc, close #1570
slandelle Aug 27, 2018
4717c9d
set useLaxCookieEncoder in DefaultAHCConfig.Builder constructor (#1573)
Aug 31, 2018
fdb95d6
[maven-release-plugin] prepare release async-http-client-project-2.5.3
slandelle Sep 4, 2018
365c1e6
[maven-release-plugin] prepare for next development iteration
slandelle Sep 4, 2018
c035ead
Fix regression introduced in d5960563dcbd09854b8ae3e416108ce770b292c2…
slandelle Oct 4, 2018
c5b6857
HttpContentDecompressor is misplaced after upgrading pipeline for HTT…
slandelle Oct 5, 2018
847e45e
Upgrade netty 4.1.30.Final
slandelle Oct 5, 2018
c2ecf92
[maven-release-plugin] prepare release async-http-client-project-2.5.4
slandelle Oct 5, 2018
cabac4a
[maven-release-plugin] prepare for next development iteration
slandelle Oct 5, 2018
e3bbad7
Add non-null ResponseBody for responses with empty body (#1585), clos…
OKoneva Oct 16, 2018
e1f6371
Allow setting headers using a Map with a subclass of CharSequence (fo…
breun Oct 19, 2018
23095ea
Bump 2.6.0-SNAPSHOT
slandelle Oct 19, 2018
7908701
Improve SpnegoEngine to allow more login configuration options (#1582)
nddipiazza Oct 19, 2018
3b3a7da
Fix SpnegoEngine.getCompleteServicePrincipalName when servicePrincipa…
nddipiazza Oct 20, 2018
97b6192
Support InputStream based multipart part (#1593), close #857
samridh90 Oct 27, 2018
d887193
[maven-release-plugin] prepare release async-http-client-project-2.6.0
slandelle Oct 29, 2018
1281264
[maven-release-plugin] prepare for next development iteration
slandelle Oct 29, 2018
2b232a4
Docs fixes/clarity improvements (#1594)
n-miles Nov 3, 2018
efdd477
Bump version 2.7.0-SNAPSHOT
slandelle Dec 6, 2018
f61f88e
Expose SSL Session of a connection to AsyncHandler.onTlsHandshakeSucc…
rolandomanrique Dec 6, 2018
16bca5c
Added BlockingConnectionSemaphoreFactory (#1586)
maltalex Dec 6, 2018
c4a2ae2
Update README.md (#1600)
gsilvestrin Dec 13, 2018
6656e9c
typo
slandelle Dec 20, 2018
02b97ed
Demonstrate AHC properly encodes chinese characters
slandelle Dec 20, 2018
29ce5fc
Fix tests
slandelle Dec 21, 2018
bdc0d75
Upgrade netty 4.1.32
sullis Jan 7, 2019
670e8d9
nit
slandelle Jan 21, 2019
e56b3e6
Reenable osgi support (#1605)
jenskordowski Jan 21, 2019
a6e5793
Upgrage netty 4.1.33.Final
slandelle Jan 21, 2019
11744c8
Upgrde rxjava2 2.2.5
slandelle Jan 21, 2019
a636799
Upgrade hamcrest 2.1
slandelle Jan 21, 2019
757237a
Upgrade mockito 2.23.4
slandelle Jan 21, 2019
92aaa57
Upgrade tomcat 9.0.14
slandelle Jan 21, 2019
ebc928b
Upgrade jetty 9.4.14.v20181114
slandelle Jan 21, 2019
9bb2be2
Upgrade retrofit 2.5.0
slandelle Jan 24, 2019
5f0590e
Fix distributionManagement urls, should be https
slandelle Jan 24, 2019
5c07a0c
[maven-release-plugin] prepare release async-http-client-project-2.7.0
slandelle Jan 24, 2019
4d915fd
[maven-release-plugin] prepare for next development iteration
slandelle Jan 24, 2019
a00d469
no need to reset, it's done in doFinal
slandelle Feb 5, 2019
1e3ed1d
Retrofit improvements (#1615)
bfg Feb 26, 2019
5b1cc77
fix repo name
slandelle Feb 27, 2019
8571b00
[maven-release-plugin] prepare release async-http-client-project-2.8.0
slandelle Feb 27, 2019
fdf9a7b
[maven-release-plugin] prepare for next development iteration
slandelle Feb 27, 2019
bbaa4c3
Retrofit http client supplier npe fix (#1617)
bfg Feb 28, 2019
fea53b0
Improved retrofit timeout handling. (#1618)
bfg Feb 28, 2019
cf2348e
Updated maven-javadoc-plugin to 3.0.1 (#1621)
bfg Feb 28, 2019
f45798c
[maven-release-plugin] prepare release async-http-client-project-2.8.1
slandelle Feb 28, 2019
4e4823a
Merge original branch 2.8.1 to forked branch
tranchitam Apr 29, 2020
7515632
Do not publish to sona
tranchitam Apr 29, 2020
d649cd9
Remove distributionManagement repo name
tranchitam Apr 29, 2020
9867087
Remove snapshoturl override
Apr 29, 2020
20eb628
Revert "Remove snapshoturl override"
Apr 30, 2020
e344083
Rotating travis secrets
Apr 30, 2020
4f46145
Don't hardcode version
tranchitam Apr 30, 2020
38eb8ed
Remove tests artifact dependency
tranchitam Apr 30, 2020
c6e49a4
Get flatten maven pom file plugin back
tranchitam Apr 30, 2020
fe35d2c
Remote repo configuration version 2.8.1 test2 (#8)
Apr 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,26 +2,22 @@ dist: xenial
language: minimal
sudo: true
services:
- docker

- docker
env:
global:
- SERVICE_NAME=async-http-client
- REVISION=2.5.3-SNAPSHOT
- secure: vto8UyM7tMHE4tUwxmYC150orDzrz/6b33m8V6+yh1uHWJmtqhyshsjLKFMmiqkAHz/7jmrgMMlHcnYJ27IyNJsqd4WNQfUjf9nRuizbRKD+yhy7R+IKbgy8bSYizyvQ/4T07sJkOcebzXJigTlOjxpwDfKgBj7vqr5paXrir0Srs0jjgyMxnASFYaBvy2i6wPyPqslkbwHwTapWg3porl/EmSj9rmgHVnPED5CPYraMp+zTHJCpP6xgGn1N3wS+x3sUDZ4MSHeZLXbaSzmIIUBNbYSUjOnEspD0Pi/78G1cl6sW7KiSIAt+H6hoy1+rU6J4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pxRodYFO6QgwobxS6kPrJQzBJJPjk82MIkvzxG1sw4BxAJBy+IctUlwLdeopXM+rUpjvfGy4Bv9QNHbma+3DA8SIL/hvHsdnKiFxVGgh7tdoWDSpKqENZptWUcPMx5OsnDT8cv4TcMiEVX5+Ya+rQYUB9qVfG34QOSnTCaCGrUIarfMSWNnFhNWDv6AqTPF3rlLxASPJ17OOnD0VMm+IfGLE6Kv7MBi99dXAqHHu1OgLbJhzCA3Wqtflkv8hZzn9CpANJbMgI=
- secure: eFF6Eyz3nluIT0nW0Dx0cCY5ho88CNZyxv8hXUUSTzuyDSfAIaPPIyTjgCNcoMxLWjEyR1NuNywcWUv50tJBeTv8U5jJSkP4SmZtMIqoFGEobOUuQ06eHPtdMhxZSjmgWbnET45AAG+lUBIwfWndItukaxGMOtuS6Lv4pjCNZeLXhLEJPeJ6OEsE1ZerqZojAFlv0Jge7D8RyVdx1pfHec85vBbpS9kfM/McntHRVDJuVsKjvIE1ExzL3L/wK4ouJxdC20rYdZv6q6zTEjbAVZWn3kDJy7jL+warL1eTv/YZda1+1TVSKFwZNgjmtV2CLIdpSlJIGmP4N3Svp/2wF+vMCEhOHB/KgiaPjefcjPT0CUOAEExoXaF2mccZysPazk8qvoQ3DU7o6BuXu/sIC5o/5qYzhlm/Ir/3xgWHsM5m7hTyol+emtt1Nhh+EGpAORIAfb6+g2acqYfgp4HsR14VPblYwd33PG3hF3aGqa5eKhX9lwYNZr98S6VyVu/1vRNyBpes8lcaVCKzQd6s5urmHQQge8HKESuJdNuLBn2m4F8/6TWgTwxywiMKezOwRVnKciJffMqkoXXmwuPEt+aHJyQp6e7zlo0pFxohNCiyxr/9Us6tXrXX6sIFVOc9uwBDYr53pRA5n3tUrJDeuLWCIGSQdB7G2ZUkI3+jtOI=
cache:
directories:
- build-cache

- build-cache
install:
- docker-compose -f docker-compose.yml build

- docker-compose -f docker-compose.yml build
script:
- docker-compose -f docker-compose.yml run ${SERVICE_NAME}

- docker-compose -f docker-compose.yml run ${SERVICE_NAME}
before_cache:
- docker-compose -f docker-compose.yml run --rm -v `pwd`/build-cache:/app/build-cache ${SERVICE_NAME} bash docker-utils.sh save-cache
- docker-compose -f docker-compose.yml run --rm -v `pwd`/build-cache:/app/build-cache
${SERVICE_NAME} bash docker-utils.sh save-cache
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ Follow [@AsyncHttpClient](https://twitter.com/AsyncHttpClient) on Twitter.
The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and asynchronously process HTTP responses.
The library also supports the WebSocket Protocol.

It's built on top of [Netty](https://github.com/netty/netty). I's currently compiled on Java 8 but runs on Java 9 too.
It's built on top of [Netty](https://github.com/netty/netty). It's currently compiled on Java 8 but runs on Java 9 too.

## Installation

@@ -110,6 +110,7 @@ Use the `addBodyPart` method to add a multipart part to the request.
This part can be of type:
* `ByteArrayPart`
* `FilePart`
* `InputStreamPart`
* `StringPart`

### Dealing with Responses
@@ -158,7 +159,7 @@ See `AsyncCompletionHandler` implementation as an example.

The below sample just capture the response status and skips processing the response body chunks.

Note that returning `ABORT` closed the underlying connection.
Note that returning `ABORT` closes the underlying connection.

```java
import static org.asynchttpclient.Dsl.*;
@@ -195,7 +196,7 @@ Integer statusCode = whenStatusCode.get();

#### Using Continuations

`ListenableFuture` has a `toCompletableFuture` that returns a `CompletableFuture`.
`ListenableFuture` has a `toCompletableFuture` method that returns a `CompletableFuture`.
Beware that canceling this `CompletableFuture` won't properly cancel the ongoing request.
There's a very good chance we'll return a `CompletionStage` instead in the next release.

@@ -243,7 +244,7 @@ WebSocket websocket = c.prepareGet("ws://demos.kaazing.com/echo")

## Reactive Streams

AsyncHttpClient has build in support for reactive streams.
AsyncHttpClient has built-in support for reactive streams.

You can pass a request body as a `Publisher<ByteBuf>` or a `ReactiveStreamsBodyGenerator`.

@@ -288,7 +289,7 @@ Keep up to date on the library development by joining the Asynchronous HTTP Clie

Of course, Pull Requests are welcome.

Here a the few rules we'd like you to respect if you do so:
Here are the few rules we'd like you to respect if you do so:

* Only edit the code related to the suggested change, so DON'T automatically format the classes you've edited.
* Use IntelliJ default formatting rules.
5 changes: 5 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
@@ -73,5 +73,10 @@
<artifactId>reactive-streams-examples</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.kerby</groupId>
<artifactId>kerb-simplekdc</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
/**
* An {@link AsyncHandler} augmented with an {@link #onCompleted(Response)}
* convenience method which gets called when the {@link Response} processing is
* finished. This class also implement the {@link ProgressAsyncHandler}
* finished. This class also implements the {@link ProgressAsyncHandler}
* callback, all doing nothing except returning
* {@link org.asynchttpclient.AsyncHandler.State#CONTINUE}
*
28 changes: 15 additions & 13 deletions client/src/main/java/org/asynchttpclient/AsyncHandler.java
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import io.netty.handler.codec.http.HttpHeaders;
import org.asynchttpclient.netty.request.NettyRequest;

import javax.net.ssl.SSLSession;
import java.net.InetSocketAddress;
import java.util.List;

@@ -37,9 +38,9 @@
* </ol>
* <br>
* Returning a {@link AsyncHandler.State#ABORT} from any of those callback methods will interrupt asynchronous response
* processing, after that only {@link #onCompleted()} is going to be called.
* processing. After that, only {@link #onCompleted()} is going to be called.
* <br>
* AsyncHandler aren't thread safe, hence you should avoid re-using the same instance when doing concurrent requests.
* AsyncHandlers aren't thread safe. Hence, you should avoid re-using the same instance when doing concurrent requests.
* As an example, the following may produce unexpected results:
* <blockquote><pre>
* AsyncHandler ah = new AsyncHandler() {....};
@@ -49,9 +50,10 @@
* </pre></blockquote>
* It is recommended to create a new instance instead.
* <p>
* Do NOT perform any blocking operation in there, typically trying to send another request and call get() on its future.
* Do NOT perform any blocking operations in any of these methods. A typical example would be trying to send another
* request and calling get() on its future.
* There's a chance you might end up in a dead lock.
* If you really to perform blocking operation, executed it in a different dedicated thread pool.
* If you really need to perform a blocking operation, execute it in a different dedicated thread pool.
*
* @param <T> Type of object returned by the {@link java.util.concurrent.Future#get}
*/
@@ -142,6 +144,8 @@ default void onHostnameResolutionSuccess(String name, List<InetSocketAddress> ad
default void onHostnameResolutionFailure(String name, Throwable cause) {
}

// ////////////// TCP CONNECT ////////

/**
* Notify the callback when trying to open a new connection.
* <p>
@@ -152,8 +156,6 @@ default void onHostnameResolutionFailure(String name, Throwable cause) {
default void onTcpConnectAttempt(InetSocketAddress remoteAddress) {
}

// ////////////// TCP CONNECT ////////

/**
* Notify the callback after a successful connect
*
@@ -174,18 +176,18 @@ default void onTcpConnectSuccess(InetSocketAddress remoteAddress, Channel connec
default void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause) {
}

// ////////////// TLS ///////////////

/**
* Notify the callback before TLS handshake
*/
default void onTlsHandshakeAttempt() {
}

// ////////////// TLS ///////////////

/**
* Notify the callback after the TLS was successful
*/
default void onTlsHandshakeSuccess() {
default void onTlsHandshakeSuccess(SSLSession sslSession) {
}

/**
@@ -196,14 +198,14 @@ default void onTlsHandshakeSuccess() {
default void onTlsHandshakeFailure(Throwable cause) {
}

// /////////// POOLING /////////////

/**
* Notify the callback when trying to fetch a connection from the pool.
*/
default void onConnectionPoolAttempt() {
}

// /////////// POOLING /////////////

/**
* Notify the callback when a new connection was successfully fetched from the pool.
*
@@ -220,6 +222,8 @@ default void onConnectionPooled(Channel connection) {
default void onConnectionOffer(Channel connection) {
}

// //////////// SENDING //////////////

/**
* Notify the callback when a request is being written on the channel. If the original request causes multiple requests to be sent, for example, because of authorization or
* retry, it will be notified multiple times.
@@ -229,8 +233,6 @@ default void onConnectionOffer(Channel connection) {
default void onRequestSend(NettyRequest request) {
}

// //////////// SENDING //////////////

/**
* Notify the callback every time a request is being retried.
*/
24 changes: 12 additions & 12 deletions client/src/main/java/org/asynchttpclient/AsyncHttpClient.java
Original file line number Diff line number Diff line change
@@ -21,15 +21,15 @@
import java.util.function.Predicate;

/**
* This class support asynchronous and synchronous HTTP request.
* This class support asynchronous and synchronous HTTP requests.
* <br>
* To execute synchronous HTTP request, you just need to do
* To execute a synchronous HTTP request, you just need to do
* <blockquote><pre>
* AsyncHttpClient c = new AsyncHttpClient();
* Future&lt;Response&gt; f = c.prepareGet(TARGET_URL).execute();
* </pre></blockquote>
* <br>
* The code above will block until the response is fully received. To execute asynchronous HTTP request, you
* The code above will block until the response is fully received. To execute an asynchronous HTTP request, you
* create an {@link AsyncHandler} or its abstract implementation, {@link AsyncCompletionHandler}
* <br>
* <blockquote><pre>
@@ -48,7 +48,7 @@
* &#125;);
* Response response = f.get();
*
* // We are just interested to retrieve the status code.
* // We are just interested in retrieving the status code.
* Future&lt;Integer&gt; f = c.prepareGet(TARGET_URL).execute(new AsyncCompletionHandler&lt;Integer&gt;() &#123;
*
* &#64;Override
@@ -63,10 +63,10 @@
* &#125;);
* Integer statusCode = f.get();
* </pre></blockquote>
* The {@link AsyncCompletionHandler#onCompleted(Response)} will be invoked once the http response has been fully read, which include
* the http headers and the response body. Note that the entire response will be buffered in memory.
* The {@link AsyncCompletionHandler#onCompleted(Response)} method will be invoked once the http response has been fully read.
* The {@link Response} object includes the http headers and the response body. Note that the entire response will be buffered in memory.
* <br>
* You can also have more control about the how the response is asynchronously processed by using a {@link AsyncHandler}
* You can also have more control about the how the response is asynchronously processed by using an {@link AsyncHandler}
* <blockquote><pre>
* AsyncHttpClient c = new AsyncHttpClient();
* Future&lt;String&gt; f = c.prepareGet(TARGET_URL).execute(new AsyncHandler&lt;String&gt;() &#123;
@@ -106,8 +106,8 @@
*
* String bodyResponse = f.get();
* </pre></blockquote>
* You can asynchronously process the response status,headers and body and decide when to
* stop the processing the response by returning a new {@link AsyncHandler.State#ABORT} at any moment.
* You can asynchronously process the response status, headers and body and decide when to
* stop processing the response by returning a new {@link AsyncHandler.State#ABORT} at any moment.
*
* This class can also be used without the need of {@link AsyncHandler}.
* <br>
@@ -125,8 +125,8 @@
* Response r = f.get();
* </pre></blockquote>
* <br>
* An instance of this class will cache every HTTP 1.1 connections and close them when the {@link DefaultAsyncHttpClientConfig#getReadTimeout()}
* expires. This object can hold many persistent connections to different host.
* An instance of this class will cache every HTTP 1.1 connection and close them when the {@link DefaultAsyncHttpClientConfig#getReadTimeout()}
* expires. This object can hold many persistent connections to different hosts.
*/
public interface AsyncHttpClient extends Closeable {

@@ -138,7 +138,7 @@ public interface AsyncHttpClient extends Closeable {
boolean isClosed();

/**
* Set default signature calculator to use for requests build by this client instance
* Set default signature calculator to use for requests built by this client instance
*
* @param signatureCalculator a signature calculator
* @return {@link RequestBuilder}
Original file line number Diff line number Diff line change
@@ -65,6 +65,14 @@ public interface AsyncHttpClientConfig {
*/
int getMaxConnectionsPerHost();

/**
* Return the maximum duration in milliseconds an {@link AsyncHttpClient} can wait to acquire a free channel
*
* @return Return the maximum duration in milliseconds an {@link AsyncHttpClient} can wait to acquire a free channel
*/
int getAcquireFreeChannelTimeout();


/**
* Return the maximum time in millisecond an {@link AsyncHttpClient} can wait when connecting to a remote host
*
Loading