Record Class ServiceConfig
java.lang.Object
java.lang.Record
org.springframework.boot.grpc.client.autoconfigure.ServiceConfig
- Record Components:
loadbalancing- load balancing configurations in the order that they should be appliedmethod- method configurationretrythrottling- retry throttling policyhealthcheck- health check configuration
public record ServiceConfig(@Nullable List<ServiceConfig.LoadBalancingConfig> loadbalancing, @Nullable List<ServiceConfig.MethodConfig> method, @Nullable ServiceConfig.RetryThrottlingPolicy retrythrottling, @Nullable ServiceConfig.HealthCheckConfig healthcheck)
extends Record
Bindable service configuration for gRPC channel. Allows type safe binding of common
service configuration options which can ultimately be applied to the
Map
provided by a GrpcClientDefaultServiceConfigCustomizer.
The configuration provided here is a subset of the canonical service_config.proto
protocol definition. For advanced or experimental service configurations, use the
GrpcClientDefaultServiceConfigCustomizer to directly add any entries supported
by grpc-java.
- Since:
- 4.1.0
- Author:
- Phillip Webb
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHealth check configuration.static final recordLoad balancing config.static final recordMethod configuration.static final recordRetry throttling policy. -
Constructor Summary
ConstructorsConstructorDescriptionServiceConfig(@Nullable List<ServiceConfig.LoadBalancingConfig> loadbalancing, @Nullable List<ServiceConfig.MethodConfig> method, @Nullable ServiceConfig.RetryThrottlingPolicy retrythrottling, @Nullable ServiceConfig.HealthCheckConfig healthcheck) Creates an instance of aServiceConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidApply this service config to the given gRPC Java config Map.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable ServiceConfig.HealthCheckConfigReturns the value of thehealthcheckrecord component.@Nullable List<ServiceConfig.LoadBalancingConfig> Returns the value of theloadbalancingrecord component.@Nullable List<ServiceConfig.MethodConfig> method()Returns the value of themethodrecord component.@Nullable ServiceConfig.RetryThrottlingPolicyReturns the value of theretrythrottlingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ServiceConfig
public ServiceConfig(@Nullable List<ServiceConfig.LoadBalancingConfig> loadbalancing, @Nullable List<ServiceConfig.MethodConfig> method, @Nullable ServiceConfig.RetryThrottlingPolicy retrythrottling, @Nullable ServiceConfig.HealthCheckConfig healthcheck) Creates an instance of aServiceConfigrecord class.- Parameters:
loadbalancing- the value for theloadbalancingrecord componentmethod- the value for themethodrecord componentretrythrottling- the value for theretrythrottlingrecord componenthealthcheck- the value for thehealthcheckrecord component
-
-
Method Details
-
applyTo
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
loadbalancing
Returns the value of theloadbalancingrecord component.- Returns:
- the value of the
loadbalancingrecord component
-
method
-
retrythrottling
Returns the value of theretrythrottlingrecord component.- Returns:
- the value of the
retrythrottlingrecord component
-
healthcheck
Returns the value of thehealthcheckrecord component.- Returns:
- the value of the
healthcheckrecord component
-