- Notifications
You must be signed in to change notification settings - Fork1
Dropwizard Integration with Jetty HTTP/1.1 and HTTP/2 client
License
NotificationsYou must be signed in to change notification settings
arteam/dropwizard-http2-client
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Dropwizard Integration with the Jetty HTTP/1.1 and HTTP/2 client
- Provides the ability to configure the client from a Dropwizard config.
- Instruments the client and register the metrics in the Dropwizard's
MetricsRegistry
- The client is managed by the Dropwizard's environment and correctly cleans resources.
h2Client:connectionTimeout:1sidleTimeout:2s
privateHttp2ClientConfigurationh2Client;@JsonPropertypublicHttp2ClientConfigurationgetH2Client() {returnh2Client;}@JsonPropertypublicvoidsetH2Client(Http2ClientConfigurationh2Client) {this.h2Client =h2Client;}
HttpClienthttpClient =newHttp2ClientBuilder(environment) .using(configuration.getH2Client()) .build("dropwizard-http2-golang");// Call `httpClient.start()` if you want to use it before the server starts up.
Don't forget to add analpn-boot
library to JVM’s bootpath:
-Xbootclasspath/p:/${user.home}/.m2/repository/org/mortbay/jetty/alpn/alpn-boot/${alpn-boot.version}/alpn-boot-${alpn-boot.version}.jar
The correct library version depends on a JVM version. Consult the Jetty ALPNguide for the reference.
- HTTP/2
connectionTimeout:1sidleTimeout:5mconnectionFactory:type:h2keyStorePath:client.jkskeyStorePassword:http2_clienttrustStorePath:servers.jkstrustStorePassword:http2_serversupportedProtocols: -'TLSv1.2'supportedCipherSuites: -'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'
- HTTP/2 Clear Text
connectionTimeout:600msidleTimeout:3mconnectionFactory:type:h2c
<dependency> <groupId>com.github.arteam</groupId> <artifactId>dropwizard-http2-client</artifactId> <version>0.4</version></dependency>
About
Dropwizard Integration with Jetty HTTP/1.1 and HTTP/2 client
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published