diff --git a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-sentinel/src/main/java/com/alibaba/cloud/sentinel/custom/SentinelBeanPostProcessor.java b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-sentinel/src/main/java/com/alibaba/cloud/sentinel/custom/SentinelBeanPostProcessor.java index 70387cd0b..17508e39f 100644 --- a/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-sentinel/src/main/java/com/alibaba/cloud/sentinel/custom/SentinelBeanPostProcessor.java +++ b/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-sentinel/src/main/java/com/alibaba/cloud/sentinel/custom/SentinelBeanPostProcessor.java @@ -167,7 +167,8 @@ public class SentinelBeanPostProcessor implements MergedBeanDefinitionPostProces private boolean checkSentinelProtect(RootBeanDefinition beanDefinition, Class beanType, String beanName) { - return beanName != null && beanType == RestTemplate.class + // Fixes #3329: Support custom RestTemplate + return beanName != null && RestTemplate.class.isAssignableFrom(beanType) && checkMethodMetadataReadingVisitor(beanDefinition); }