1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

add switch for @SentinelRestTemplate

This commit is contained in:
fangjian0423 2019-03-13 15:56:26 +08:00
parent ca5d5282a5
commit a59011fa93
2 changed files with 7 additions and 0 deletions

View File

@ -166,6 +166,7 @@ public class SentinelAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@ConditionalOnClass(name = "org.springframework.web.client.RestTemplate")
@ConditionalOnProperty(name = "resttemplate.sentinel.enabled", havingValue = "true", matchIfMissing = true)
public SentinelBeanPostProcessor sentinelBeanPostProcessor(
ApplicationContext applicationContext) {
return new SentinelBeanPostProcessor(applicationContext);

View File

@ -6,6 +6,12 @@
"defaultValue": true,
"description": "enable or disable sentinel auto configure."
},
{
"name": "resttemplate.sentinel.enabled",
"type": "java.lang.Boolean",
"defaultValue": true,
"description": "enable or disable @SentinelRestTemplate."
},
{
"name": "spring.cloud.sentinel.eager",
"type": "java.lang.Boolean",