Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusMaven Central

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'sMetricsRegistry
  • The client is managed by the Dropwizard's environment and correctly cleans resources.

Example of the usage:

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.

Runtime dependencies

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.

Examples of configurations

  • 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

Maven dependency

<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

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp