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

Updated README and MIGRATION files #1479

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Before you start

**Riptide 4** requires java 17 or or up.
**Riptide 4** requires Spring 6 or or up.
**Riptide 4** requires Java 17 or up.
**Riptide 4** requires Spring 6 or up.

## Failsafe

Expand Down Expand Up @@ -40,6 +40,10 @@ The `SpanDecorators` obtained by `ServiceLoaderSpanDecorator`
(via the [`ServiceLoader`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html) facility)
are loaded eagerly and only once.

## OpenTracing FlowId Starter

As the project is in maintenance mode and no changes are planned anymore including support for newer Spring versions,
it was decided to include an adapted copy into Riptide itself, so the dependency is not needed anymore.

# Riptide 3.0 Migration Guide

Expand Down
39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ protocol and Java. Riptide allows users to leverage the power of HTTP with its u
- **Status**: Actively maintained and used in production.
- Riptide is unique in the way that it doesn't abstract HTTP away, but rather embraces it!

:rotating_light: **Upgrading from 2.x to 3.x?** Please refer to the [Migration Guide](MIGRATION.md).
:rotating_light: If you want to upgrade from an older version to the latest one, consult the following migration guides:
- **Upgrading from 3.x to 4.x?** Please refer to the [Migration Guide](MIGRATION.md#riptide-40-migration-guide).
- **Upgrading from 2.x to 3.x?** Please refer to the [Migration Guide](MIGRATION.md#riptide-30-migration-guide).

## Example

Expand Down Expand Up @@ -71,8 +73,8 @@ Go checkout the [concept document](docs/concepts.md) for more details.

## Dependencies

- Spring 4.1 or higher
- :warning: Spring Boot integration requires Spring 5
- Java 17
- Spring 6

## Installation

Expand Down Expand Up @@ -226,30 +228,19 @@ In order to configure the thread pool correctly, please refer to

### Non-blocking IO

Riptide supports two kinds of request factories:

**[`ClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/ClientHttpRequestFactory.html)**

The following implementations offer blocking IO:
:rotating_light: While the previous versions of Riptide supported both, blocking and non-blocking request factories,
due to the removal of `AsyncClientHttpRequestFactory` in Spring 6, Riptide 4 only supports blocking request factories:

- [`ApacheClientHttpRequestFactory`](riptide-httpclient), using the [Apache HTTP Client](https://hc.apache.org/httpcomponents-client-ga/)
- ~[`HttpComponentsClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html)~, please use the none above
- [`SimpleClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/SimpleClientHttpRequestFactory.html), using [`HttpURLConnection`](https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html)

**[`AsyncClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/AsyncClientHttpRequestFactory.html)**

The following implementations offer non-blocking IO:

- ~[`HttpComponentsClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html)~, please use the one above
- [`SimpleClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/SimpleClientHttpRequestFactory.html), using [`HttpURLConnection`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/HttpURLConnection.html)
- [`OkHttp3ClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.html), using [OkHttp](https://square.github.io/okhttp/)
- [`Netty4ClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/Netty4ClientHttpRequestFactory.html), using [Netty](https://netty.io/)
- [`HttpComponentsAsyncClientHttpRequestFactory`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsAsyncClientHttpRequestFactory.html), using [Apache HTTP Async Client](https://hc.apache.org/httpcomponents-asyncclient-4.1.x/index.html)

Non-blocking IO is asynchronous by nature. In order to provide asynchrony for blocking IO you need to register an executor. Not passing an executor will make all network communication synchronous, i.e. all futures returned by Riptide will already be completed.
In order to provide asynchrony for blocking IO you need to register an executor. Not passing an executor will make all network communication synchronous, i.e. all futures returned by Riptide will already be completed.

| | Synchronous | Asynchronous |
|-----------------|----------------------------|-----------------------------------------|
| Blocking IO | `ClientHttpRequestFactory` | `Executor` + `ClientHttpRequestFactory` |
| Non-blocking IO | n/a | `AsyncClientHttpRequestFactory` |
| Synchronous | Asynchronous |
|----------------------------|-----------------------------------------|
| `ClientHttpRequestFactory` | `Executor` + `ClientHttpRequestFactory` |

## Usage

Expand Down Expand Up @@ -355,7 +346,7 @@ Please consult the [Plugin documentation](riptide-core/src/main/java/org/zalando

### Testing

Riptide is built on the same foundation as Spring's `RestTemplate` and `AsyncRestTemplate`. That allows us, with a small
Riptide is built on the same foundation as Spring's `RestTemplate`. That allows us, with a small
trick, to use the same testing facilities, the [`MockRestServiceServer`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/client/MockRestServiceServer.html):

```java
Expand All @@ -376,7 +367,7 @@ See [here](riptide-spring-boot-starter#testing).

## Getting help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's [Issue Tracker](../../../issues).
If you have questions, concerns, bug reports, etc., please file an issue in this repository's [Issue Tracker](issues).

## Getting involved/Contributing

Expand Down
1 change: 0 additions & 1 deletion riptide-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

## Dependencies

- Java 8
- Riptide: Core

## Installation
Expand Down
1 change: 0 additions & 1 deletion riptide-capture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Order order = http.get("/sales-orders/{id}", id)

## Dependencies

- Java 8
- Riptide: Core

## Installation
Expand Down
1 change: 0 additions & 1 deletion riptide-chaos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Http.builder()

## Dependencies

- Java 8
- Riptide: Core

## Installation
Expand Down
12 changes: 2 additions & 10 deletions riptide-compatibility/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ User user = http.getForObject("/user/{id}", User.class, 1);

- Compatibility adapters for
- [RestOperations (**RestTemplate** API)](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/RestOperations.html)
- [AsyncRestOperations (**AsyncRestTemplate** API)](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/AsyncRestOperations.html)

## Dependencies

- Java 8
- Java 17
- Riptide: Core
- Riptide: Capture
- Riptide: Problem
Expand All @@ -46,12 +45,6 @@ RestOperations http = new HttpOperations(Http.builder()
.build());
```

```java
AsyncRestOperations http = new AsyncHttpOperations(Http.builder()
// ...
.build());
```

### Default Routing Tree

The default routing tree can be overridden:
Expand Down Expand Up @@ -88,8 +81,7 @@ ResponseEntity<User> response = http.getForEntity("/users/{id}", User.class, 1);
```

Any operation within [RestOperations](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/RestOperations.html)
and [AsyncRestOperations](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/client/AsyncRestOperations.html)
are supported.
is supported.

## Getting Help

Expand Down
1 change: 0 additions & 1 deletion riptide-compression/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

## Dependencies

- Java 8
- Riptide: Core

## Installation
Expand Down
2 changes: 1 addition & 1 deletion riptide-concurrent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var pool = ThreadPoolExecutors.builder()

## Dependencies

- Java 8
- Java 17

## Installation

Expand Down
1 change: 0 additions & 1 deletion riptide-failsafe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Http.builder().requestFactory(new HttpComponentsClientHttpRequestFactory())

## Dependencies

- Java 8
- Riptide Core
- Failsafe

Expand Down
1 change: 0 additions & 1 deletion riptide-faults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

## Dependencies

- Java 8
- Riptide: Core

## Installation
Expand Down
12 changes: 1 addition & 11 deletions riptide-httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final Http http = Http.builder()

## Dependencies

- Java 8
- Java 17

## Installation

Expand Down Expand Up @@ -74,16 +74,6 @@ new ApacheClientHttpRequestFactory(client, Mode.BUFFERING)
</dd>
</dl>

The `RestAsyncClientHttpRequestFactory` implements `ClientHttpRequestFactory` **as well as**
`AsyncClientHttpRequestFactory` and can therefore be used with both: `RestTemplate` and `AsyncRestTemplate`.

```java
RestAsyncClientHttpRequestFactory factory = ...;

RestTemplate sync = new RestTemplate(factory);
AsyncRestTemplate async = new AsyncRestTemplate(factory);
```

## Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's [Issue Tracker](../../../../issues).
Expand Down
1 change: 0 additions & 1 deletion riptide-logbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Http.builder()

## Dependencies

- Java 8
- Riptide: Core

## Installation
Expand Down
1 change: 0 additions & 1 deletion riptide-micrometer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Http.builder()

## Dependencies

- Java 8
- Riptide Core
- [Micrometer](https://micrometer.io/)

Expand Down
1 change: 0 additions & 1 deletion riptide-opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Http.builder()

## Dependencies

- Java 8
- Riptide Core
- [OpenTelemetry Java API](https://opentelemetry.io/docs/instrumentation/java/)
- [Riptide: Failsafe](../riptide-failsafe) (optional)
Expand Down
1 change: 0 additions & 1 deletion riptide-opentracing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Http.builder()

## Dependencies

- Java 8
- Riptide Core
- [OpenTracing Java API](https://opentracing.io/guides/java/)
- [Riptide: Failsafe](../riptide-failsafe) (optional)
Expand Down
1 change: 0 additions & 1 deletion riptide-problem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ http.post("/").dispatch(series(),

## Dependencies

- Java 8
- Riptide: Core
- Problem

Expand Down
1 change: 0 additions & 1 deletion riptide-soap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ http.post()

## Dependencies

- Java 8
- JAXB
- Riptide Core

Expand Down
15 changes: 1 addition & 14 deletions riptide-spring-boot-autoconfigure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ private Http example;

## Dependencies

- Java 8
- Spring Boot 2
- Spring Boot 3
- Riptide
- Core
- (Apache) HTTP Client
Expand Down Expand Up @@ -224,18 +223,6 @@ Required when `tracing` is enabled.
</dependency>
```

#### X-Flow-ID

Required when `propagate-flow-id` is enabled.

```xml
<dependency>
<groupId>org.zalando</groupId>
<artifactId>opentracing-flowid-starter</artifactId>
<version>${opentracing-toolbox.version}</version>
</dependency>
```

#### OpenTelemetry

Required when `telemetry` is enabled.
Expand Down