Override to supply a custom ClientId, e.g., override protected def clientId(injector: Injector): ClientId = ClientId("myclient") }}}
Override to supply a custom ClientId, e.g., override protected def clientId(injector: Injector): ClientId = ClientId("myclient") }}}
The default requires a ClientId be bound to the injector, for example via a ThriftClientIdModule.
This method allows for extended configuration of the base MethodBuilder (e.g., the MethodBuilder used as a starting point for all method configurations) not exposed by this module or for overriding provided defaults, e.g.,
This method allows for extended configuration of the base MethodBuilder (e.g., the MethodBuilder used as a starting point for all method configurations) not exposed by this module or for overriding provided defaults, e.g.,
override def configureMethodBuilder(methodBuilder: thriftmux.MethodBuilder): thriftmux.MethodBuilder = { methodBuilder .withTimeoutTotal(5.seconds) }
Note: any configuration here will be applied to all methods unless explicitly overridden. However, also note that filters are cumulative. Thus filters added here will be present in any final configuration.
a com.twitter.inject.Injector instance
the thriftmux.MethodBuilder to configure.
a configured MethodBuilder which will be used as the starting point for any per-method configuration.
Configure the ServicePerEndpoint.
Configure the ServicePerEndpoint. This is done by using the given ThriftMethodBuilderFactory to configure a com.twitter.inject.thrift.ThriftMethodBuilder for a given ThriftMethod. E.g.,
servicePerEndpoint .withFetchBlob( builder.method(FetchBlob) ...
Subclasses of this module MAY provide an implementation of configureServicePerEndpoint
which
specifies configuration of a ServicePerEndpoint
interface per-method of the interface.
a com.twitter.inject.Injector instance
a ThriftMethodBuilderFactory for creating a com.twitter.inject.thrift.ThriftMethodBuilder.
the ServicePerEndpoint to configure.
a per-method filtered ServicePerEndpoint
This method allows for further configuration of the ThriftMux client for parameters not exposed by this module or for overriding defaults provided herein, e.g.,
This method allows for further configuration of the ThriftMux client for parameters not exposed by this module or for overriding defaults provided herein, e.g.,
override def configureThriftMuxClient(client: ThriftMux.Client): ThriftMux.Client = { client .withProtocolFactory(myCustomProtocolFactory)) .withStatsReceiver(someOtherScopedStatsReceiver) .withMonitor(myAwesomeMonitor) .withTracer(notTheDefaultTracer) .withResponseClassifier(ThriftResponseClassifier.ThriftExceptionsAsFailures) }
the com.twitter.inject.Injector which can be used to help configure the given com.twitter.finagle.ThriftMux.Client.
the com.twitter.finagle.ThriftMux.Client to configure.
a configured ThriftMux.Client.
A TwitterModule which allows for configuration of a
ThriftMux
client. The client interface can be expressed as aservice-per-endpoint
or aMethodPerEndpoint
.Provides bindings for a Scrooge-generated
service-per-endpoint
andMethodPerEndpoint
. TheMethodPerEndpoint
is constructed via the MethodPerEndpointBuilder and is thus implemented as a thin wrapper over theservice-per-endpoint
.This TwitterModule allows users to configure and filter a Scrooge-generated
service-per-endpoint
per-method which can then be used directly or can be wrapped by aMethodPerEndpoint
.A Scrooge-generated ServicePerEndpoint
A Scrooge-generated MethodPerEndpoint
This TwitterModule expects a com.twitter.finagle.thrift.ClientId to be bound to the object graph but does not assume how it is done. A com.twitter.finagle.thrift.ClientId can be bound by including the ThriftClientIdModule in your server configuration.
,When applying filters, filter order matters. The order in which filters are applied is the order in which requests will flow through to the service and the opposite of the order in which responses return. See the ThriftMethodBuilderFactory for more information.
What is ThriftMux?
Finagle Clients
ReqRepServicePerEndpoint
ServicePerEndpoint
MethodPerEndpoint