pom

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
    <version>0.9.0.RELEASE</version>
</dependency>

application.yml 

server:
  port: 8888
spring:
  application:
    name: nacos-provider
  cloud:
    sentinel:
      transport:
        port: 8719
        dashboard: 127.0.0.1:8080

 

controller 

@GetMapping("/hi")
@SentinelResource(value="hi")
public String hi(@RequestParam(value = "name",defaultValue = "forezp",required = false)String name){

    return "hi "+name;
}

访问  127.0.0.0:8888/hi  会注册到sentinel中心 

sentinel springboot版本 使用

 

 

 

 

相关文章:

  • 2021-12-25
  • 2021-12-12
  • 2021-08-21
  • 2021-04-29
  • 2021-07-28
  • 2021-05-21
  • 2022-12-23
  • 2021-06-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案