[2021.x] Fix: SentinelRestTemplate support custom RestTemplate (#3329) (#3345)

* Fix: SentinelRestTemplate support custom RestTemplate (#3329)

* Add fix comment (#3329)
pull/3340/merge
RuanSheng 2 years ago committed by GitHub
parent 853baca093
commit 9b121fa92d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}

Loading…
Cancel
Save