-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use immutable approach to configuration and to use @Confi…
…gBean
- Loading branch information
1 parent
ab8a972
commit adbb2b1
Showing
46 changed files
with
849 additions
and
907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Connections | ||
---- | ||
|
||
# Server Connection Providers | ||
|
||
Níma server uses SPI to discover how to handle a specific incoming connection. | ||
The main entry point is `ServerConnectionProvider` - a service loader provider interface to discover | ||
which connections are supported. | ||
|
||
We have the following implementations currently: | ||
|
||
- `Http1ConnectionProvider` - support for the usual HTTP/1.1 connections | ||
- `Http2ConnectionProvider` - support for "prior-knowledge" HTTP/2 connections | ||
|
||
The connection provider creates a configured `ServerConnectionSelector`, which is then used at runtime. | ||
The selector works based on initial bytes of the connection. | ||
|
||
|
||
# HTTP/1.1 Upgrade Providers | ||
|
||
HTTP/1.1 supports the concept of upgrading a connection. This is supported through | ||
`Http1UpgradeProvider` - a service loader provider interface to discover which upgrades are supported. | ||
|
||
We have the following implementations currently: | ||
|
||
- `Http2UpgradeProvider` - upgrade to HTTP/2 using upgrade | ||
- `WsUpgradeProvider` - upgrade to Níma WebSocket implementation | ||
- `TyrusUpgradeProvider` - upgrade to MP Tyrus WebSocket implementation (higher weight than WsUpgradeProvider) | ||
|
||
The upgrade provider creates a configured `Http1Upgrader`, which is then used at runtime. | ||
Upgraders work based on protocol identificator (`h2c`, `websocket`). When more than one for the same protocol is configured, | ||
the provider with higher weight will be used. | ||
|
||
# Configurability | ||
|
||
ALl of connection providers, HTTP/1.1 upgrade providers and HTTP/2 subprotocols are configured under `server.connection-providers`, to have a single configuration of a protocol regardless whether this is accessed directly or through upgrade mechanism. | ||
|
||
The configuration key is the one provided by the Connection provider, HTTP/1.1 Upgrade provider, or HTTP/2 SubProtocol provider `configKey()` or `configKeys()` method. | ||
|
||
As all providers are configured on the same leave, each provider should have a descriptive and unique configuration key | ||
relevant to its purpose. | ||
|
||
Example of such configuration (Tyrus and Níma WebSocket both use `websocket`, as only one of them can be active): | ||
```yaml | ||
server: | ||
connection-providers: | ||
http_1_1: | ||
max-prologue-length: 4096 | ||
websocket: | ||
origins: ["origin1"] | ||
http_2: | ||
max-frame-size: 128000 | ||
grpc: | ||
something: "value" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
...ources/META-INF/native-image/io.helidon.media/helidon-media-jsonp/native-image.properties
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
.../resources/META-INF/native-image/io.helidon.media/helidon-media-jsonp/reflect-config.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.