Class SentinelProtectInterceptor
java.lang.Object
com.alibaba.cloud.sentinel.custom.SentinelProtectInterceptor
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class SentinelProtectInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
Interceptor using by SentinelRestTemplate.
- Author:
- Jim
-
Constructor Summary
ConstructorsConstructorDescriptionSentinelProtectInterceptor(SentinelRestTemplate sentinelRestTemplate, org.springframework.web.client.RestTemplate restTemplate) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)
-
Constructor Details
-
SentinelProtectInterceptor
public SentinelProtectInterceptor(SentinelRestTemplate sentinelRestTemplate, org.springframework.web.client.RestTemplate restTemplate)
-
-
Method Details
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException - Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Throws:
IOException
-