Skip to content

Commit

Permalink
Rename default branch to main
Browse files Browse the repository at this point in the history
  • Loading branch information
nicmunroe committed Feb 24, 2022
1 parent 9c2aeb0 commit ab123c0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Released on 2020-08-05.
### Updated

- Updated Wingtips version from `0.22.0` to `0.23.0`.
[Wingtips changelog](https://github.com/Nike-Inc/wingtips/blob/master/CHANGELOG.md).
[Wingtips changelog](https://github.com/Nike-Inc/wingtips/blob/main/CHANGELOG.md).
+ Updated by [Nic Munroe][contrib_nicmunroe] in pull request [#137](https://github.com/Nike-Inc/riposte/pull/137).

## [0.19.1](https://github.com/Nike-Inc/riposte/releases/tag/riposte-v0.19.1)
Expand Down Expand Up @@ -139,7 +139,7 @@ Released on 2019-07-10.
- Updated Wingtips from `0.19.1` -> `0.20.1`. WARNING: This includes breaking changes, although most services shouldn't
be affected. In particular, if you're using the `%X{spanJson}` SLF4J log pattern in your service's logs then you'll
need to do some extra work to get that back. This update also includes some performance and feature improvements.
See the [Wingtips changelog](https://github.com/Nike-Inc/wingtips/blob/master/CHANGELOG.md) for full details.
See the [Wingtips changelog](https://github.com/Nike-Inc/wingtips/blob/main/CHANGELOG.md) for full details.
+ Updated by [Nic Munroe][contrib_nicmunroe] in pull request [#126](https://github.com/Nike-Inc/riposte/pull/126).

### Changed
Expand Down Expand Up @@ -495,10 +495,10 @@ encountered to be more informative.
### Updated

- Updated Wingtips to version `0.14.1` from `0.11.2`.
[Wingtips changelog](https://github.com/Nike-Inc/wingtips/blob/master/CHANGELOG.md)
[Wingtips changelog](https://github.com/Nike-Inc/wingtips/blob/main/CHANGELOG.md)
- Updated by [Nic Munroe][contrib_nicmunroe] in pull request [#90](https://github.com/Nike-Inc/riposte/pull/90).
- Updated Backstopper to version `0.11.4` from `0.11.1`.
[Backstopper changelog](https://github.com/Nike-Inc/backstopper/blob/master/CHANGELOG.md)
[Backstopper changelog](https://github.com/Nike-Inc/backstopper/blob/main/CHANGELOG.md)
- Updated by [Nic Munroe][contrib_nicmunroe] in pull request [#92](https://github.com/Nike-Inc/riposte/pull/92).

### Project Build
Expand Down Expand Up @@ -685,7 +685,7 @@ Released on 2016-12-12.

### Updated

- Updated Backstopper dependency version to 0.11.0 ([backstopper changelog](https://github.com/Nike-Inc/backstopper/blob/master/CHANGELOG.md)).
- Updated Backstopper dependency version to 0.11.0 ([backstopper changelog](https://github.com/Nike-Inc/backstopper/blob/main/CHANGELOG.md)).
- Updated by [Nic Munroe][contrib_nicmunroe] in pull request [#13](https://github.com/Nike-Inc/riposte/pull/13).

## [0.8.1](https://github.com/Nike-Inc/riposte/releases/tag/riposte-v0.8.1)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ There are a few guidelines that we need contributors to follow so that we are ab

## Making Changes

* Create a topic branch off of `master` before you start your work.
* Please avoid working directly on the `master` branch.
* Create a topic branch off of `main` before you start your work.
* Please avoid working directly on the `main` branch.
* Make commits of logical units.
* You may be asked to squash unnecessary commits down to logical units.
* Check for unnecessary whitespace with `git diff --check` before committing.
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

Java 8 is required.

***Please see the [template microservice project](https://github.com/Nike-Inc/riposte-microservice-template) for the recommended starter template project AND usage documentation.*** The template project is a production-ready microservice with a number of bells and whistles and the template project's [README.md](https://github.com/Nike-Inc/riposte-microservice-template/blob/master/README.md) contains in-depth usage information and should be consulted first when learning how to use Riposte.
***Please see the [template microservice project](https://github.com/Nike-Inc/riposte-microservice-template) for the recommended starter template project AND usage documentation.*** The template project is a production-ready microservice with a number of bells and whistles and the template project's [README.md](https://github.com/Nike-Inc/riposte-microservice-template/blob/main/README.md) contains in-depth usage information and should be consulted first when learning how to use Riposte.

That said, the following class is a simple Java application containing a fully-functioning Riposte server. It represents the minimal code necessary to run a Riposte server. You can hit this server by calling `http://localhost:8080/hello` and it will respond with a `text/plain` payload of `Hello, world!`.

Expand Down Expand Up @@ -127,7 +127,7 @@ object HelloWorldEndpoint extends StandardEndpoint[Void, String] {

## Template Microservice Project

It's been mentioned already, but it bears repeating: ***Please see the [template microservice project](https://github.com/Nike-Inc/riposte-microservice-template) for the recommended starter template project AND usage documentation.*** The template project is a production-ready microservice with a number of bells and whistles and the template project's [README.md](https://github.com/Nike-Inc/riposte-microservice-template/blob/master/README.md) contains in-depth usage information and should be consulted first when learning how to use Riposte. The rest of the documentation below in *this* readme will be focused on the Riposte core libraries.
It's been mentioned already, but it bears repeating: ***Please see the [template microservice project](https://github.com/Nike-Inc/riposte-microservice-template) for the recommended starter template project AND usage documentation.*** The template project is a production-ready microservice with a number of bells and whistles and the template project's [README.md](https://github.com/Nike-Inc/riposte-microservice-template/blob/main/README.md) contains in-depth usage information and should be consulted first when learning how to use Riposte. The rest of the documentation below in *this* readme will be focused on the Riposte core libraries.

## Riposte Libraries

Expand All @@ -136,7 +136,7 @@ Riposte is a collection of several libraries, mainly divided up based on depende
* [riposte-spi](riposte-spi/) - Contains the main interfaces and classes necessary to define the interface for a Riposte server.
* [riposte-core](riposte-core/) - Builds on `riposte-spi` to provide a fully functioning Riposte server.
* [riposte-async-http-client2](riposte-async-http-client2/) - Contains
[`AsyncHttpClientHelper`](https://github.com/Nike-Inc/riposte/blob/master/riposte-async-http-client2/src/main/java/com/nike/riposte/client/asynchttp/ning/AsyncHttpClientHelper.java),
[`AsyncHttpClientHelper`](https://github.com/Nike-Inc/riposte/blob/main/riposte-async-http-client2/src/main/java/com/nike/riposte/client/asynchttp/AsyncHttpClientHelper.java),
an HTTP client for performing async nonblocking calls using `CompletableFuture`s with distributed tracing baked in.
This is a wrapper around the [Async Http Client](https://github.com/AsyncHttpClient/async-http-client) libraries.
* [riposte-async-http-client](riposte-async-http-client/) - **DEPRECATED - Please use riposte-async-http-client2.**
Expand All @@ -146,7 +146,7 @@ The older version of `AsyncHttpClientHelper`, built around the
is based on).
* [riposte-metrics-codahale](riposte-metrics-codahale/) - Contains metrics support for Riposte using the `io.dropwizard` version of Codahale metrics.
* [riposte-metrics-codahale-signalfx](riposte-metrics-codahale-signalfx/) - Contains SignalFx-specific extensions of the `riposte-metrics-codahale` library module.
* [riposte-auth](riposte-auth/) - Contains a few implementations of the Riposte [`RequestSecurityValidator`](https://github.com/Nike-Inc/riposte/blob/master/riposte-spi/src/main/java/com/nike/riposte/server/error/validation/RequestSecurityValidator.java), e.g. for basic auth and other security schemes.
* [riposte-auth](riposte-auth/) - Contains a few implementations of the Riposte [`RequestSecurityValidator`](https://github.com/Nike-Inc/riposte/blob/main/riposte-spi/src/main/java/com/nike/riposte/server/error/validation/RequestSecurityValidator.java), e.g. for basic auth and other security schemes.
* [riposte-guice](riposte-guice/) - Contains helper classes for seamlessly integrating Riposte with Google Guice.
* [riposte-typesafe-config](riposte-typesafe-config/) - Contains helper classes for seamlessly integrating Riposte with Typesafe Config for properties management.
* [riposte-guice-typesafe-config](riposte-guice-typesafe-config/) - Contains helper classes that require both Google Guice *and* Typesafe Config.
Expand All @@ -160,10 +160,10 @@ These libraries are all deployed to Maven Central and JCenter and can be pulled

Full documentation on the Riposte libraries will be coming eventually. In the meantime the javadocs for Riposte classes are fairly fleshed out and give good guidance, and the [template microservice project](https://github.com/Nike-Inc/riposte-microservice-template) is a reasonable user guide. Here are some important classes to get you started:

* [`com.nike.riposte.server.Server`](https://github.com/Nike-Inc/riposte/blob/master/riposte-core/src/main/java/com/nike/riposte/server/Server.java) - The Riposte server class. Binds to a port and listens for incoming HTTP requests. Uses [`ServerConfig`](https://github.com/Nike-Inc/riposte/blob/master/riposte-spi/src/main/java/com/nike/riposte/server/config/ServerConfig.java) for all configuration purposes.
* [`com.nike.riposte.server.config.ServerConfig`](https://github.com/Nike-Inc/riposte/blob/master/riposte-spi/src/main/java/com/nike/riposte/server/config/ServerConfig.java) - Responsible for configuring a Riposte server. There are lots of options and the javadocs explain what everything does and recommended usage.
* [`com.nike.riposte.server.http.StandardEndpoint`](https://github.com/Nike-Inc/riposte/blob/master/riposte-core/src/main/java/com/nike/riposte/server/http/StandardEndpoint.java) - A "typical" endpoint where you receive the full request and provide a full response. The javadocs in `StandardEndpoint`'s class hierarchy ([`com.nike.riposte.server.http.NonblockingEndpoint`](https://github.com/Nike-Inc/riposte/blob/master/riposte-spi/src/main/java/com/nike/riposte/server/http/NonblockingEndpoint.java) and [`com.nike.riposte.server.http.Endpoint`](https://github.com/Nike-Inc/riposte/blob/master/riposte-spi/src/main/java/com/nike/riposte/server/http/Endpoint.java)) are worth reading as well for usage guidelines and to see what endpoint options are available.
* [`com.nike.riposte.server.http.ProxyRouterEndpoint`](https://github.com/Nike-Inc/riposte/blob/master/riposte-core/src/main/java/com/nike/riposte/server/http/ProxyRouterEndpoint.java) - A "proxy" or "router" style endpoint where you control the "first chunk" of the downstream request (downstream host, port, headers, path, query params, etc) and the payload is streamed to the destination immediately as chunks come in from the caller. The response is similarly streamed back to the caller immediately as chunks come back from the downstream server. This is incredibly efficient and fast, allowing you to provide proxy/routing capabilities on tiny servers without any fear of large payloads causing OOM, the whole of Java at your fingertips for implementing complex routing logic, and all while enjoying sub-millisecond lag times added by the Riposte server.
* [`com.nike.riposte.server.Server`](https://github.com/Nike-Inc/riposte/blob/main/riposte-core/src/main/java/com/nike/riposte/server/Server.java) - The Riposte server class. Binds to a port and listens for incoming HTTP requests. Uses [`ServerConfig`](https://github.com/Nike-Inc/riposte/blob/main/riposte-spi/src/main/java/com/nike/riposte/server/config/ServerConfig.java) for all configuration purposes.
* [`com.nike.riposte.server.config.ServerConfig`](https://github.com/Nike-Inc/riposte/blob/main/riposte-spi/src/main/java/com/nike/riposte/server/config/ServerConfig.java) - Responsible for configuring a Riposte server. There are lots of options and the javadocs explain what everything does and recommended usage.
* [`com.nike.riposte.server.http.StandardEndpoint`](https://github.com/Nike-Inc/riposte/blob/main/riposte-core/src/main/java/com/nike/riposte/server/http/StandardEndpoint.java) - A "typical" endpoint where you receive the full request and provide a full response. The javadocs in `StandardEndpoint`'s class hierarchy ([`com.nike.riposte.server.http.NonblockingEndpoint`](https://github.com/Nike-Inc/riposte/blob/main/riposte-spi/src/main/java/com/nike/riposte/server/http/NonblockingEndpoint.java) and [`com.nike.riposte.server.http.Endpoint`](https://github.com/Nike-Inc/riposte/blob/main/riposte-spi/src/main/java/com/nike/riposte/server/http/Endpoint.java)) are worth reading as well for usage guidelines and to see what endpoint options are available.
* [`com.nike.riposte.server.http.ProxyRouterEndpoint`](https://github.com/Nike-Inc/riposte/blob/main/riposte-core/src/main/java/com/nike/riposte/server/http/ProxyRouterEndpoint.java) - A "proxy" or "router" style endpoint where you control the "first chunk" of the downstream request (downstream host, port, headers, path, query params, etc) and the payload is streamed to the destination immediately as chunks come in from the caller. The response is similarly streamed back to the caller immediately as chunks come back from the downstream server. This is incredibly efficient and fast, allowing you to provide proxy/routing capabilities on tiny servers without any fear of large payloads causing OOM, the whole of Java at your fingertips for implementing complex routing logic, and all while enjoying sub-millisecond lag times added by the Riposte server.

## Performance Comparisons

Expand Down Expand Up @@ -202,7 +202,7 @@ This test measures the simplest "hello world" type API, with a single endpoint t
<a name="perf_test_async"></a>
### Async non-blocking endpoint performance

This test measures how well the stacks perform when executing asynchronous non-blocking tasks. For a real service this might mean using a NIO client for database or HTTP calls (e.g. Riposte's [`AsyncHttpClientHelper`](https://github.com/Nike-Inc/riposte/blob/master/riposte-async-http-client/src/main/java/com/nike/riposte/client/asynchttp/ning/AsyncHttpClientHelper.java)) to do the vast majority of the endpoint's work, where the endpoint is just waiting for data from an outside process (and therefore NIO allows us to wait without using a blocking thread).
This test measures how well the stacks perform when executing asynchronous non-blocking tasks. For a real service this might mean using a NIO client for database or HTTP calls (e.g. Riposte's [`AsyncHttpClientHelper`](https://github.com/Nike-Inc/riposte/blob/main/riposte-async-http-client/src/main/java/com/nike/riposte/client/asynchttp/ning/AsyncHttpClientHelper.java)) to do the vast majority of the endpoint's work, where the endpoint is just waiting for data from an outside process (and therefore NIO allows us to wait without using a blocking thread).

For these tests we simulate that scenario by returning `CompletableFutures` that are completed with a "hello world" payload after a 130 millisecond delay using a scheduler. In the case of Riposte we can reuse the built-in Netty scheduler via `ctx.executor().schedule(...)` calls, and for Spring Boot we reuse a scheduler created via `Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() * 2)` to match the Netty scheduler as closely as possible. In both cases the thread count on the application remains small and stable even when handling thousands of concurrent requests.

Expand Down Expand Up @@ -234,7 +234,7 @@ For these tests we simulate that scenario by returning `CompletableFutures` that
<a name="perf_test_proxy_router"></a>
### Proxy/router performance

One of Riposte's endpoint types ([`ProxyRouterEndpoint`](https://github.com/Nike-Inc/riposte/blob/master/riposte-core/src/main/java/com/nike/riposte/server/http/ProxyRouterEndpoint.java)) is for proxy and/or routing use cases where you can adjust request and/or response headers and determine the destination of the call, but otherwise leave the payload alone. This allows Riposte to stream chunks to and from the destination and caller as they become available rather than waiting for the entire request/response to enter memory. The end result is a system that lets you use Riposte as a proxy or router on very low-end hardware and still get excellent performance; payload size essentially doesn't matter - e.g. you can act as a proxy/router piping gigabyte payloads between systems on a box that only has a few hundred megabytes of RAM allocated to Riposte. It also doesn't matter if the downstream service takes 5 seconds or 5 milliseconds to respond since Riposte uses nonblocking I/O under the hood and you won't end up with an explosion of threads.
One of Riposte's endpoint types ([`ProxyRouterEndpoint`](https://github.com/Nike-Inc/riposte/blob/main/riposte-core/src/main/java/com/nike/riposte/server/http/ProxyRouterEndpoint.java)) is for proxy and/or routing use cases where you can adjust request and/or response headers and determine the destination of the call, but otherwise leave the payload alone. This allows Riposte to stream chunks to and from the destination and caller as they become available rather than waiting for the entire request/response to enter memory. The end result is a system that lets you use Riposte as a proxy or router on very low-end hardware and still get excellent performance; payload size essentially doesn't matter - e.g. you can act as a proxy/router piping gigabyte payloads between systems on a box that only has a few hundred megabytes of RAM allocated to Riposte. It also doesn't matter if the downstream service takes 5 seconds or 5 milliseconds to respond since Riposte uses nonblocking I/O under the hood and you won't end up with an explosion of threads.

These kinds of robust proxy/routing features are not normally available in Java microservice stacks, so to provide a performance comparison we put Riposte up against industry-leading NGINX. Riposte does not win the raw performance crown vs. NGINX (it's unlikely any Java-based solution could), however:

Expand Down
Loading

0 comments on commit ab123c0

Please sign in to comment.