Recheck for null service instance to avoid micrometer NPE. (#1197)
This commit is contained in:
committed by
GitHub
parent
483798a7d2
commit
a4a37cd975
@@ -53,6 +53,7 @@
|
||||
|spring.cloud.loadbalancer.retry.retry-on-all-operations | `+++false+++` | Indicates retries should be attempted on operations other than `HttpMethod.GET`}.
|
||||
|spring.cloud.loadbalancer.retry.retryable-status-codes | `+++{}+++` | A `Set` of status codes that should trigger a retry.
|
||||
|spring.cloud.loadbalancer.service-discovery.timeout | | String representation of Duration of the timeout for calls to service discovery.
|
||||
|spring.cloud.loadbalancer.stats.micrometer.enabled | `+++false+++` | Enables Spring Cloud LoadBalancer Micrometer stats.
|
||||
|spring.cloud.loadbalancer.sticky-session.add-service-instance-cookie | `+++false+++` | Indicates whether a cookie with the newly selected instance should be added by LoadBalancer.
|
||||
|spring.cloud.loadbalancer.sticky-session.instance-id-cookie-name | `+++sc-lb-instance-id+++` | The name of the cookie holding the preferred instance id.
|
||||
|spring.cloud.loadbalancer.use-raw-status-code-in-response-data | `+++false+++` | Indicates that raw status codes should be used in {@link ResponseData}.
|
||||
|
||||
@@ -105,6 +105,9 @@ public class BlockingLoadBalancerClient implements LoadBalancerClient {
|
||||
@Override
|
||||
public <T> T execute(String serviceId, ServiceInstance serviceInstance, LoadBalancerRequest<T> request)
|
||||
throws IOException {
|
||||
if (serviceInstance == null) {
|
||||
throw new IllegalArgumentException("Service Instance cannot be null");
|
||||
}
|
||||
DefaultResponse defaultResponse = new DefaultResponse(serviceInstance);
|
||||
Set<LoadBalancerLifecycle> supportedLifecycleProcessors = getSupportedLifecycleProcessors(serviceId);
|
||||
Request lbRequest = request instanceof Request ? (Request) request : new DefaultRequest<>();
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
"name": "spring.cloud.loadbalancer.enabled",
|
||||
"description": "Enables Spring Cloud LoadBalancer.",
|
||||
"type": "java.lang.Boolean"
|
||||
},
|
||||
{
|
||||
"defaultValue": "false",
|
||||
"name": "spring.cloud.loadbalancer.stats.micrometer.enabled",
|
||||
"description": "Enables Spring Cloud LoadBalancer Micrometer stats.",
|
||||
"type": "java.lang.Boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user