Skip to content
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

Create new async client based on Reactor Netty #123

Merged
merged 38 commits into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fe4dc9a
Kick off Reactor Netty based client
acogoluegnes Apr 24, 2018
f60bbbe
Clean code of ReactorNettyClient for re-use
acogoluegnes Apr 24, 2018
904f3a3
Add roadmap items to ReactorNettyClient
acogoluegnes Apr 25, 2018
572c756
Don't rely on UriComponentsBuilder in ReactorNettyClient
acogoluegnes Apr 27, 2018
931dd01
Use Mono<String> for Authorization header
acogoluegnes Apr 30, 2018
885a409
Add URI path encoding and HTTP response wrapper
acogoluegnes May 2, 2018
5b880c8
Implement several HTTP endpoints
acogoluegnes May 2, 2018
35a3b29
Bump dependencies on 1.3.x
acogoluegnes May 2, 2018
2c685c7
Merge branch '1.3.x-stable'
acogoluegnes May 2, 2018
4706c0c
Bump Reactor release train to Bismuth-SR8
acogoluegnes May 2, 2018
2074451
Fix compilation issue
acogoluegnes May 2, 2018
9fa8644
Implement more endpoints in Reactor Netty client
acogoluegnes May 3, 2018
8092e34
Add options to make Reactor Netty client configurable
acogoluegnes May 3, 2018
1ed4fe0
Add missing tests for Reactor Netty client
acogoluegnes May 3, 2018
b3695fa
Add Javadoc to Reactor Netty client
acogoluegnes May 3, 2018
79046be
Propagate JSON exception
acogoluegnes May 3, 2018
89100f0
Bump Spring version to 4.3.17
acogoluegnes May 14, 2018
5b28558
Merge branch '1.3.x-stable'
acogoluegnes May 14, 2018
a0cd820
Bump Spring to 5.0.6 and Reactor to Bismuth-SR9
acogoluegnes May 14, 2018
ef54e3e
[artifactory-release] Release version 1.3.2.RELEASE
spring-builds May 14, 2018
cd5a4cd
[artifactory-release] Next development version
spring-builds May 14, 2018
b4db01e
[artifactory-release] Release version 2.0.2.RELEASE
spring-builds May 14, 2018
8405d17
[artifactory-release] Next development version
spring-builds May 14, 2018
4ba9632
Merge branch '1.3.x-stable'
acogoluegnes May 14, 2018
120b00b
Use 2.0.2.RELEASE in readme
acogoluegnes May 14, 2018
fb5558a
Kick off Reactor Netty based client
acogoluegnes Apr 24, 2018
52f4a49
Clean code of ReactorNettyClient for re-use
acogoluegnes Apr 24, 2018
95bea10
Add roadmap items to ReactorNettyClient
acogoluegnes Apr 25, 2018
cd31689
Don't rely on UriComponentsBuilder in ReactorNettyClient
acogoluegnes Apr 27, 2018
99e6379
Use Mono<String> for Authorization header
acogoluegnes Apr 30, 2018
411b91c
Add URI path encoding and HTTP response wrapper
acogoluegnes May 2, 2018
49ac638
Implement several HTTP endpoints
acogoluegnes May 2, 2018
265925f
Implement more endpoints in Reactor Netty client
acogoluegnes May 3, 2018
a1031ef
Add options to make Reactor Netty client configurable
acogoluegnes May 3, 2018
f31b4f2
Add missing tests for Reactor Netty client
acogoluegnes May 3, 2018
0c1c63b
Add Javadoc to Reactor Netty client
acogoluegnes May 3, 2018
304e5b1
Propagate JSON exception
acogoluegnes May 3, 2018
1910b03
Merge branch 'reactor-netty-client' of github.com:rabbitmq/hop into r…
acogoluegnes May 15, 2018
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add the following to your `pom.xml`:
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>http-client</artifactId>
<version>2.0.1.RELEASE</version>
<version>2.0.2.RELEASE</version>
</dependency>
```

Expand All @@ -44,7 +44,7 @@ Add the following to your `pom.xml`:
Add the following to your `build.gradle`:

``` groovy
compile "com.rabbitmq:http-client:2.0.1.RELEASE"
compile "com.rabbitmq:http-client:2.0.2.RELEASE"
```


Expand Down
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,27 @@ compileTestJava {
}

ext {
amqpClientVersion='5.1.2'
commonsHttpClientVersion = '4.5.3'
groovyVersion = '2.4.13'
jacksonVersion = '2.9.4'
amqpClientVersion='5.2.0'
commonsHttpClientVersion = '4.5.5'
groovyVersion = '2.4.15'
jacksonVersion = '2.9.5'
spockVersion = "1.1-groovy-2.4"
reactorVersion = "Bismuth-SR3"
springVersion = '5.0.3.RELEASE'
reactorVersion = "Bismuth-SR9"
springVersion = '5.0.6.RELEASE'
reactorNettyVersion = '0.7.7.RELEASE'

linkHomepage = 'https://github.com/rabbitmq/hop'
linkCi = 'https://build.spring.io/browse/RMQ'
linkIssue = 'https://github.com/rabbitmq/hop/issues'
linkScmUrl = 'https://github.com/rabbitmq/hop'
linkScmConnection = 'https://github.com/rabbitmq/hop.git'
linkScmDevConnection = '[email protected]:rabbitmq/hop.git'

javadocLinks = ["http://docs.oracle.com/javase/7/docs/api/",
"http://docs.oracle.com/javaee/6/api/",
"http://www.reactive-streams.org/reactive-streams-1.0.2-javadoc/",
"http://projectreactor.io/docs/core/release/api/",
"https://fasterxml.github.io/jackson-databind/javadoc/2.9/"] as String[]
}

dependencyManagement {
Expand All @@ -63,7 +70,7 @@ dependencies {
compile "org.springframework:spring-webflux:$springVersion"
compile "org.apache.httpcomponents:httpclient:$commonsHttpClientVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "io.projectreactor.ipc:reactor-netty"
compile "io.projectreactor.ipc:reactor-netty:$reactorNettyVersion"

testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile "org.spockframework:spock-core:$spockVersion"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.0.2.BUILD-SNAPSHOT
version=2.0.3.BUILD-SNAPSHOT
7 changes: 1 addition & 6 deletions src/main/java/com/rabbitmq/http/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,7 @@ private URI uriWithPath(final String path) {
}

private String encodePathSegment(final String pathSegment) {
try {
return UriUtils.encodePathSegment(pathSegment, "UTF-8");
} catch (UnsupportedEncodingException e) {
// the best we can do without messing up all caller signatures :/ MK.
return pathSegment;
}
return UriUtils.encodePathSegment(pathSegment, "UTF-8");
}

private List<HttpMessageConverter<?>> getMessageConverters() {
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/com/rabbitmq/http/client/HttpClientException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.rabbitmq.http.client;

/**
*
*/
public class HttpClientException extends HttpException {

static final long serialVersionUID = 1;

public HttpClientException(reactor.ipc.netty.http.client.HttpClientException cause) {
super(cause);
}

public int status() {
return cause().status().code();
}

public String reason() {
return cause().status().reasonPhrase();
}

private reactor.ipc.netty.http.client.HttpClientException cause() {
return (reactor.ipc.netty.http.client.HttpClientException) getCause();
}
}
29 changes: 29 additions & 0 deletions src/main/java/com/rabbitmq/http/client/HttpException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.rabbitmq.http.client;

/**
*
*/
public class HttpException extends RuntimeException {

static final long serialVersionUID = 1;

public HttpException(Throwable cause) {
super(cause);
}
}
50 changes: 50 additions & 0 deletions src/main/java/com/rabbitmq/http/client/HttpResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.rabbitmq.http.client;

import java.util.Collections;
import java.util.Map;

/**
*
*/
public class HttpResponse {

private final int status;

private final String reason;

private final Map<String, String> headers;

public HttpResponse(int status, String reason, Map<String, String> headers) {
this.status = status;
this.reason = reason;
this.headers = Collections.unmodifiableMap(headers);
}

public int getStatus() {
return status;
}

public String getReason() {
return reason;
}

public Map<String, String> getHeaders() {
return headers;
}
}
Loading