class MyHttpClientModule
extends HttpClientModuleTrait {
overridedef dest: String = "/s/my/service"overridedef label: String = "myservice"overrideprotecteddef sessionAcquisitionTimeout: Duration = 1.seconds
overrideprotecteddef requestTimeout: Duration = 5.seconds
overrideprotecteddef retryBudget: RetryBudget = RetryBudget(15.seconds, 5, .1)
// if you want to customize the client configuration// you can://// override def configureClient(// injector: Injector,// client: Http.Client// ): Http.Client =// client.// withTracer(NullTracer)// withStatsReceiver(NullStatsReceiver)//// You can configure TLS on the client directly//// override def configureClient(// injector: Injector,// client: Http.Client// ): Http.Client = client.withTls("yourSslHostName")//// depending on your client type, you may want to provide a global instance,// otherwise you might want to specify how your consumers can provide a binding// for an instance to the client//// ex:// @Provides// @Singleton// final def provideFinagleClient(// injector: Injector,// statsReceiver: StatsReceiver// ): Http.Client = newClient(injector, statsReceiver)//// Or create a service directly//// ex:// @Provides// @Singleton// final def provideMyService(// injector: Injector,// statsReceiver: StatsReceiver// ): Service[Request, Response] =// myCoolFilter.andThen(newService(injector, statsReceiver))//// Or provide the `com.twitter.finatra.httpclient.HttpClient`//// ex:// @Provides// @Singleton// final def provideMyHttpClient(// injector: Injector,// statsReceiver: StatsReceiver,// mapper: FinatraObjectMapper// ): HttpClient = newHttpClient(injector, statsReceiver, mapper)
}
Note
This trait does not define any @Provide annotations or bindings.
Extending this trait allows for configuring an com.twitter.finagle.Http.Client and/or a com.twitter.finatra.httpclient.HttpClient.
This trait does not define any
@Provide
annotations or bindings.