├── first-plugin-demo ├── template │ ├── config │ │ └── config.yaml │ └── template-plugin │ │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── io.sermant.core.plugin.agent.declarer.PluginDeclarer │ │ └── java │ │ └── io │ │ └── sermant │ │ └── template │ │ └── TemplateDeclarer.java ├── config │ ├── bootstrap.properties │ └── plugins.yaml ├── application │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── template │ │ ├── Application.java │ │ └── Controller.java └── pom.xml ├── monitor-demo ├── src │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── example │ │ └── demo │ │ └── MonitorDemoApplication.java └── pom.xml ├── xds-demo ├── product │ ├── spring-client │ │ ├── start.sh │ │ ├── build-client.sh │ │ └── Dockerfile │ ├── spring-server │ │ ├── start.sh │ │ ├── build-server.sh │ │ └── Dockerfile │ └── script │ │ ├── spring-server-destination.yaml │ │ ├── spring-server-virtureservice.yaml │ │ ├── spring-server-virtureservice-flowcontrol.yaml │ │ ├── mysql.yaml │ │ ├── spring-client.yaml │ │ └── spring-client-flowcontrol.yaml ├── spring-cloud-server-xds │ └── src │ │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── io │ │ └── sermant │ │ └── demo │ │ └── xds │ │ └── spring │ │ └── server │ │ └── SpringCloudServerApplication.java └── spring-cloud-client-xds │ └── src │ └── main │ ├── resources │ └── application.yml │ └── java │ └── io │ └── sermant │ └── demo │ └── xds │ └── spring │ └── client │ ├── SpringCloudClientApplication.java │ └── config │ └── RestTemplateConfig.java ├── mq-consume-prohibition-demo ├── kafka-demo │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── mq │ │ └── demo │ │ └── KafkaDemoApplication.java └── pom.xml ├── tag-transmission-demo ├── http-server-demo │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── tag │ │ └── demo │ │ ├── ServerDemoApplication.java │ │ └── ServerController.java ├── http-client-demo │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── tag │ │ └── demo │ │ ├── ClientDemoApplication.java │ │ └── ClientController.java └── pom.xml ├── router-demo ├── dubbo-router-demo │ ├── deployment │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ ├── provider │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ └── spring-cloud-gateway │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ └── k8s │ │ │ ├── consumer.yaml │ │ │ ├── provider.yaml │ │ │ ├── gray-provider.yaml │ │ │ └── spring-cloud-getaway.yaml │ ├── dubbo-b │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.yaml │ │ │ │ └── dubbo │ │ │ │ │ └── provider.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── dubbotest │ │ │ │ └── service │ │ │ │ └── DubboBApplication.java │ │ └── pom.xml │ ├── dubbo-a │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.yaml │ │ │ │ └── dubbo │ │ │ │ │ └── provider.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── dubbotest │ │ │ │ └── service │ │ │ │ ├── imp │ │ │ │ └── ATestImp.java │ │ │ │ └── DubboAApplication.java │ │ └── pom.xml │ ├── spring-cloud-gateway │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.yaml │ │ │ └── dubbo │ │ │ │ └── consumer.xml │ │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── dubbotest │ │ │ └── GatewayApplication.java │ ├── dubbo-demo-common │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── huawei │ │ │ │ └── dubbotest │ │ │ │ ├── service │ │ │ │ ├── ATest.java │ │ │ │ └── BTest.java │ │ │ │ └── domain │ │ │ │ └── Test.java │ │ └── pom.xml │ └── pom.xml ├── full-link-route-demo │ ├── deployment │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ ├── providerA │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ ├── providerB │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ ├── providerA-gray │ │ │ │ ├── start.sh │ │ │ │ ├── Dockerfile │ │ │ │ └── build.sh │ │ │ └── providerB-gray │ │ │ │ ├── start.sh │ │ │ │ ├── Dockerfile │ │ │ │ └── build.sh │ │ └── k8s │ │ │ ├── consumer.yaml │ │ │ ├── providerA.yaml │ │ │ ├── providerB.yaml │ │ │ ├── providerA-gray.yaml │ │ │ └── providerB-gray.yaml │ ├── consumer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ConsumerController.java │ │ │ └── ConsumerApplication.java │ ├── providerA │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ProviderApplication.java │ │ │ └── ProviderController.java │ ├── providerB │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ProviderApplication.java │ │ │ └── ProviderController.java │ ├── providerA-gray │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ProviderApplication.java │ │ │ └── ProviderController.java │ ├── providerB-gray │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ProviderApplication.java │ │ │ └── ProviderController.java │ └── pom.xml ├── spring-cloud-router-demo │ ├── deployment │ │ ├── images │ │ │ ├── zuul │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── Dockerfile │ │ │ │ └── build.sh │ │ │ └── provider │ │ │ │ ├── start.sh │ │ │ │ ├── Dockerfile │ │ │ │ └── build.sh │ │ └── k8s │ │ │ ├── spring-cloud-router-consumer.yaml │ │ │ ├── spring-cloud-router-provider.yaml │ │ │ ├── spring-cloud-router-gray-provider.yaml │ │ │ └── spring-cloud-router-zuul.yaml │ ├── spring-cloud-router-provider │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.yml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── huaweicloud │ │ │ │ └── examples │ │ │ │ └── router │ │ │ │ └── ProviderApplication.java │ │ └── pom.xml │ ├── spring-cloud-router-consumer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yml │ │ │ └── java │ │ │ └── com │ │ │ └── huaweicloud │ │ │ └── examples │ │ │ └── router │ │ │ └── client │ │ │ └── ProviderClient.java │ ├── spring-cloud-router-zuul │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yml │ │ │ └── java │ │ │ └── com │ │ │ └── huaweicloud │ │ │ └── examples │ │ │ └── router │ │ │ └── ZuulApplication.java │ └── pom.xml └── pom.xml ├── grace-demo └── spring-grace-nacos-demo │ ├── deploy │ ├── stat.sh │ ├── invoke-hot.sh │ ├── invoke.sh │ ├── image │ │ ├── dataDockerfile │ │ ├── consumerDockerfile │ │ ├── providerDockerfile │ │ ├── startData.sh │ │ ├── startConsumer.sh │ │ ├── startProvider.sh │ │ ├── buildData.sh │ │ ├── build.sh │ │ └── buildConsumer.sh │ ├── graceDown │ │ └── data.yaml │ └── warmUp │ │ └── data.yaml │ ├── nacos-rest-provider │ └── src │ │ └── main │ │ ├── resources │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── com.alibaba.csp.sentinel.slotchain.ProcessorSlot │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── huawei │ │ └── nacos │ │ └── rest │ │ └── provider │ │ └── stat │ │ └── QpsUtils.java │ ├── nacos-rest-data │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.yml │ │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── nacos │ │ │ └── rest │ │ │ └── data │ │ │ └── NacosDataApplication.java │ └── pom.xml │ ├── nacos-rest-consumer │ └── src │ │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── huawei │ │ └── nacos │ │ └── rest │ │ └── consumer │ │ ├── stat │ │ └── RequestStat.java │ │ ├── entity │ │ └── MyHashMap.java │ │ └── Configuration.java │ └── nacos-common │ └── pom.xml ├── registry-demo ├── dubbo-registry-demo │ ├── deployment │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ └── provider │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ └── k8s │ │ │ ├── dubbo-registry-provider.yaml │ │ │ └── dubbo-registry-consumer.yaml │ ├── dubbo-registry-consumer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.yaml │ │ │ └── dubbo │ │ │ │ └── consumer.xml │ │ │ └── java │ │ │ └── com │ │ │ └── huaweicloud │ │ │ └── examples │ │ │ └── registry │ │ │ ├── ConsumerApplication.java │ │ │ └── controller │ │ │ └── HelloController.java │ ├── dubbo-registry-provider │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.yaml │ │ │ └── dubbo │ │ │ │ └── provider.xml │ │ │ └── java │ │ │ └── com │ │ │ └── huaweicloud │ │ │ └── examples │ │ │ └── registry │ │ │ ├── ProviderApplication.java │ │ │ └── service │ │ │ └── HelloServiceImpl.java │ └── dubbo-registry-api │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── examples │ │ └── registry │ │ └── api │ │ └── HelloService.java ├── spring-cloud-consul-registry-demo │ ├── deployment │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ └── provider │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ └── k8s │ │ │ ├── consumer.yaml │ │ │ └── provider.yaml │ ├── consul-consumer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ConsumerController.java │ │ │ └── ConsumerApplication.java │ ├── consul-provider │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── ProviderController.java │ │ │ └── ProviderApplication.java │ └── pom.xml ├── spring-cloud-eureka-registry-demo │ ├── deployment │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ └── provider │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ └── k8s │ │ │ ├── consumer.yaml │ │ │ └── provider.yaml │ ├── eureka-consumer │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── EurekaConsumerApplication.java │ │ │ └── EurekaConsumerController.java │ ├── eureka-provider │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ ├── EurekaProviderController.java │ │ │ └── EurekaProviderApplication.java │ ├── eureka-server │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── cloud │ │ │ └── demos │ │ │ └── EurekaServerApplication.java │ └── pom.xml ├── spring-cloud-registry-demo │ ├── deployment │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ └── provider │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ └── k8s │ │ │ ├── spring-cloud-registry-provider.yaml │ │ │ └── spring-cloud-registry-consumer.yaml │ ├── spring-cloud-registry-provider │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.yml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── huaweicloud │ │ │ │ └── examples │ │ │ │ └── registry │ │ │ │ ├── ProviderApplication.java │ │ │ │ └── controller │ │ │ │ └── ProviderController.java │ │ └── pom.xml │ ├── spring-cloud-registry-consumer │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.yml │ └── pom.xml ├── springboot-registry-demo │ ├── service-b │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── service │ │ │ └── b │ │ │ └── ServiceBApplication.java │ └── service-a │ │ └── src │ │ └── main │ │ ├── resources │ │ └── application.yaml │ │ └── java │ │ └── com │ │ └── huawei │ │ └── service │ │ └── a │ │ └── ServiceAApplication.java └── pom.xml ├── flowcontrol-demo ├── spring-cloud-demo │ ├── development │ │ ├── images │ │ │ ├── consumer │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ │ └── provider │ │ │ │ ├── start.sh │ │ │ │ ├── build.sh │ │ │ │ └── Dockerfile │ │ └── k8s │ │ │ ├── provider.yaml │ │ │ └── consumer.yaml │ ├── spring-provider │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── com │ │ │ └── huaweicloud │ │ │ └── examples │ │ │ └── flow │ │ │ └── provider │ │ │ └── SpringProviderApplication.java │ └── spring-consumer │ │ └── src │ │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── examples │ │ └── flow │ │ └── consumer │ │ └── FeignRequest.java └── pom.xml ├── database-write-prohibition-demo ├── mongodb-demo │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── com │ │ │ └── huaweicloud │ │ │ └── sermant │ │ │ └── mongodb │ │ │ └── MongoDbApplication.java │ └── pom.xml └── pom.xml ├── removal-demo ├── rest-provider │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.yml │ └── pom.xml └── rest-consumer │ ├── src │ └── main │ │ └── resources │ │ └── application.yml │ └── pom.xml ├── loadbalancer-demo ├── resttemplate-consumer │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.yml │ │ │ └── java │ │ │ └── com │ │ │ └── huawei │ │ │ └── zk │ │ │ └── resttemplate │ │ │ └── consumer │ │ │ └── Configuration.java │ └── pom.xml └── resttemplate-provider │ ├── src │ └── main │ │ └── resources │ │ └── application.yml │ └── pom.xml ├── visibility-demo ├── dubbo-2-6-integration-consumer │ └── src │ │ └── main │ │ ├── resources │ │ ├── META-INF │ │ │ └── dubbo │ │ │ │ └── internal │ │ │ │ └── com.alibaba.dubbo.rpc.Filter │ │ └── application.yaml │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── integration │ │ └── controller │ │ └── RemovalController.java ├── dubbo-2-6-integration-provider │ └── src │ │ └── main │ │ ├── resources │ │ └── application.yaml │ │ └── java │ │ └── com │ │ └── huaweicloud │ │ └── integration │ │ └── service │ │ ├── BarServiceImpl.java │ │ ├── Bar2ServiceImpl.java │ │ └── RemovalServiceImpl.java └── dubbo-integration-api │ └── src │ └── main │ └── java │ └── com │ └── huaweicloud │ └── integration │ ├── service │ ├── RemovalService.java │ ├── BarService.java │ ├── FlowControlVersionService.java │ ├── MetadataService.java │ └── impl │ │ └── FlowControlVersionServiceImpl.java │ ├── configuration │ └── LbCache.java │ ├── constants │ └── Constant.java │ ├── entity │ └── LaneTestEntity.java │ └── client │ └── ProviderClient.java ├── .github ├── pull_request_template.md ├── ISSUE_TEMPLATE │ ├── question_consult.yaml │ ├── enhancement.yaml │ └── bug_report.yaml └── workflows │ └── stale.yml ├── mq-gray-demo ├── rocketmq-gray-demo │ ├── rocketmq-gray-consumer-demo │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.yaml │ │ │ └── java │ │ │ └── io │ │ │ └── sermant │ │ │ └── demo │ │ │ └── grayscale │ │ │ └── rocketmq │ │ │ └── consumer │ │ │ └── RocketMqConsumerApplication.java │ └── rocketmq-gray-producer-demo │ │ └── src │ │ └── main │ │ ├── resources │ │ └── application.yaml │ │ └── java │ │ └── io │ │ └── sermant │ │ └── demo │ │ └── grayscale │ │ └── rocketmq │ │ └── producer │ │ └── RocketMqProducerApplication.java └── pom.xml └── pom.xml /first-plugin-demo/template/config/config.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /monitor-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /xds-demo/product/spring-client/start.sh: -------------------------------------------------------------------------------- 1 | exec java -jar /home/spring-client.jar 2 | -------------------------------------------------------------------------------- /xds-demo/product/spring-server/start.sh: -------------------------------------------------------------------------------- 1 | exec java -jar /home/spring-server.jar 2 | -------------------------------------------------------------------------------- /xds-demo/product/spring-client/build-client.sh: -------------------------------------------------------------------------------- 1 | docker build -f Dockerfile -t spring-client:1.0.0 . -------------------------------------------------------------------------------- /xds-demo/product/spring-server/build-server.sh: -------------------------------------------------------------------------------- 1 | docker build -f Dockerfile -t spring-server:1.0.0 . -------------------------------------------------------------------------------- /mq-consume-prohibition-demo/kafka-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=7070 2 | -------------------------------------------------------------------------------- /tag-transmission-demo/http-server-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9003 2 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/dubbo-a.jar -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/dubbo-b.jar -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /homeconsumer.jar -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/stat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | endpoint=127.0.0.1:31021 3 | watch curl ${endpoint}/stat 4 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerA/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/providerA.jar -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerB/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/providerB.jar -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerA-gray/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/providerA.jar -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerB-gray/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/providerB.jar -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/dubbo-registry-consumer.jar -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/dubbo-registry-provider.jar -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /homeconsumer.jar -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/provider.jar -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /homeconsumer.jar -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/provider.jar -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/zuul/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/spring-cloud-router-zuul.jar -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/spring-cloud-gateway/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/spring-cloud-gateway.jar -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java $OTHER_ENV -jar /home/spring-consumer.jar 4 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java $OTHER_ENV -jar /home/spring-provider.jar 4 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/spring-cloud-router-consumer.jar -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/spring-cloud-router-provider.jar -------------------------------------------------------------------------------- /database-write-prohibition-demo/mongodb-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | mongodb.address=mongodb://localhost:27017 2 | server.port=30110 -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/images/consumer/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/spring-cloud-registry-consumer.jar -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/images/provider/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec java -jar /home/spring-cloud-registry-provider.jar -------------------------------------------------------------------------------- /tag-transmission-demo/http-client-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9002 2 | http.server.ip=127.0.0.1 3 | http.server.port=9003 4 | -------------------------------------------------------------------------------- /removal-demo/rest-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8004 3 | spring: 4 | application: 5 | name: rest-provider 6 | timeout: 0 -------------------------------------------------------------------------------- /first-plugin-demo/template/template-plugin/src/main/resources/META-INF/services/io.sermant.core.plugin.agent.declarer.PluginDeclarer: -------------------------------------------------------------------------------- 1 | io.sermant.template.TemplateDeclarer -------------------------------------------------------------------------------- /loadbalancer-demo/resttemplate-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8005 3 | spring: 4 | application: 5 | name: zk-rest-consumer 6 | -------------------------------------------------------------------------------- /loadbalancer-demo/resttemplate-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8004 3 | spring: 4 | application: 5 | name: zk-rest-provider 6 | -------------------------------------------------------------------------------- /removal-demo/rest-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8005 3 | spring: 4 | application: 5 | name: rest-consumer 6 | timeout: 1000 7 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-consumer/src/main/resources/META-INF/dubbo/internal/com.alibaba.dubbo.rpc.Filter: -------------------------------------------------------------------------------- 1 | getlb=com.huaweicloud.integration.filter.LbFilter 2 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/invoke-hot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | endpoint=127.0.0.1:31021 3 | url=${endpoint}/graceHot 4 | while true 5 | do 6 | echo `curl -s ${url}` 7 | done 8 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-provider/src/main/resources/META-INF/services/com.alibaba.csp.sentinel.slotchain.ProcessorSlot: -------------------------------------------------------------------------------- 1 | com.huawei.nacos.rest.provider.stat.QpsSlot 2 | -------------------------------------------------------------------------------- /xds-demo/product/spring-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8 2 | WORKDIR /home 3 | COPY spring-server.jar /home/spring-server.jar 4 | COPY start.sh /home 5 | RUN chmod -R 777 /home 6 | ENTRYPOINT ["sh", "/home/start.sh"] 7 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | **What type of PR is this?** 2 | 3 | Feature/Bug/Refactor etc. 4 | 5 | **What this PR does / why we need it?** 6 | 7 | Describe it. 8 | 9 | **Which issue(s) this PR fixes?** 10 | 11 | Fixes # -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=dubbo-a 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=dubbo-b 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /xds-demo/product/spring-client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8 2 | WORKDIR /home 3 | COPY agent/ /home/agent 4 | COPY spring-client.jar /home/spring-client.jar 5 | COPY start.sh /home 6 | RUN chmod -R 777 /home 7 | ENTRYPOINT ["sh", "/home/start.sh"] 8 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/spring-provider/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8003 3 | sermant: sermant 4 | spring: 5 | application: 6 | name: spring-flow-provider 7 | cloud: 8 | zookeeper: 9 | enabled: true -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY dubbo-a.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY dubbo-b.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerA/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=providerA 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerB/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=providerB 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerA/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY providerA.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerB/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY providerB.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerA-gray/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY providerA.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerA-gray/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=providerA-gray 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerB-gray/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY providerB.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/images/providerB-gray/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=providerB-gray 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName 9 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-provider 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName 9 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=dubbo-registry-consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=dubbo-registry-provider 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=provider 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=provider 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/springboot-registry-demo/service-b/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: service-b 4 | server: 5 | port: 8006 6 | config: 7 | domain: www.domain.com 8 | downStream: service-b 9 | sleepMs: 1 10 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/zuul/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-cloud-router-zuul 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-cloud-router-provider 4 | 5 | server: 6 | port: 8162 7 | 8 | feign: 9 | hystrix: 10 | enabled: true -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] 12 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-provider.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] 12 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY dubbo-registry-consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY dubbo-registry-provider.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY provider.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY provider.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/spring-cloud-gateway/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-cloud-gateway 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/zuul/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-cloud-router-zuul.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-data/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8008 3 | spring: 4 | application: 5 | name: nacos-rest-data 6 | cloud: 7 | nacos: 8 | discovery: 9 | server-addr: localhost:8848 10 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/images/spring-cloud-gateway/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-cloud-gateway.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-cloud-router-consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-cloud-router-consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-cloud-router-provider.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-cloud-router-provider 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /xds-demo/spring-cloud-server-xds/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-server 4 | cloud: 5 | zookeeper: 6 | connect-string: ${ZOOKEEPER_IP}:2181 7 | enabled: ${ZOOKEEPER_ENABLED:false} 8 | server: 9 | port: 8081 -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/invoke.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | endpoint=127.0.0.1:31021 3 | openUrl=${endpoint}/graceDownOpen 4 | closeUrl=${endpoint}/graceDownClose 5 | while true 6 | do 7 | echo `curl -s ${openUrl}` 8 | echo `curl -s ${closeUrl}` 9 | done 10 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/images/consumer/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-cloud-registry-consumer 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/images/provider/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | 3 | version=1.0.0 4 | name=spring-cloud-registry-provider 5 | dockerFile=Dockerfile 6 | imageName=$name:$version 7 | docker build -f $dockerFile -t $imageName . 8 | docker push $imageName -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/images/consumer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-cloud-registry-consumer.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/images/provider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | 3 | WORKDIR /home 4 | 5 | COPY spring-cloud-registry-provider.jar /home 6 | 7 | COPY start.sh /home 8 | 9 | RUN chmod -R 777 /home 10 | 11 | ENTRYPOINT ["sh", "/home/start.sh"] -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/spring-cloud-registry-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-cloud-registry-provider 4 | cloud: 5 | zookeeper: 6 | connect-string: localhost:2181 7 | 8 | server: 9 | port: 8162 -------------------------------------------------------------------------------- /mq-gray-demo/rocketmq-gray-demo/rocketmq-gray-consumer-demo/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9000 3 | rocketmq: 4 | address: 127.0.0.1:9876 5 | topic: MESSAGE-GRAY 6 | management: 7 | endpoints: 8 | web: 9 | exposure: 10 | include: "*" -------------------------------------------------------------------------------- /mq-gray-demo/rocketmq-gray-demo/rocketmq-gray-producer-demo/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9030 3 | rocketmq: 4 | address: 127.0.0.1:9876 5 | topic: MESSAGE-GRAY 6 | management: 7 | endpoints: 8 | web: 9 | exposure: 10 | include: "*" -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/spring-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8005 3 | spring: 4 | application: 5 | name: spring-flow-consumer 6 | cloud: 7 | zookeeper: 8 | enabled: true 9 | feign: 10 | hystrix: 11 | enabled: true 12 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | 4 | spring: 5 | application: 6 | name: consumer 7 | 8 | eureka: 9 | client: 10 | service-url: 11 | defaultZone: http://127.0.0.1:8666/eureka -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-provider/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8002 3 | 4 | spring: 5 | application: 6 | name: provider 7 | 8 | eureka: 9 | client: 10 | service-url: 11 | defaultZone: http://127.0.0.1:8666/eureka -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-server/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8666 3 | 4 | spring: 5 | application: 6 | name: eureka-server 7 | 8 | eureka: 9 | client: 10 | service-url: 11 | defaultZone: http://127.0.0.1:8666/eureka -------------------------------------------------------------------------------- /first-plugin-demo/config/bootstrap.properties: -------------------------------------------------------------------------------- 1 | # 指定当前Sermant制品的制品名,用于在多Sermant场景中标识不同的Sermant制品,基于artifact隔离不同Sermant的配置及服务治理能力 2 | artifact=default 3 | # 指定Sermant当前接入实例所归属实例的应用名 4 | appName=default 5 | # 指定Sermant当前接入实例所归属实例的应用类型 6 | appType=default 7 | # 指定Sermant当前接入实例所归属实例的服务名 8 | serviceName=default -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/dataDockerfile: -------------------------------------------------------------------------------- 1 | FROM ascdc/jdk8:latest 2 | 3 | WORKDIR /home 4 | 5 | COPY jars/nacos-rest-data-2.2.0.RELEASE.jar /home 6 | COPY startData.sh /home 7 | 8 | RUN chmod -R 777 /home 9 | EXPOSE 8004 5009 10 | ENTRYPOINT ["sh", "/home/startData.sh"] 11 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-b/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 28022 3 | dubbo: 4 | application: 5 | name: dubbo-b 6 | protocol: 7 | name: dubbo 8 | port: 28822 9 | registry: 10 | address: sc://127.0.0.1:30100 11 | 12 | test: 13 | version: V1 -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/consumerDockerfile: -------------------------------------------------------------------------------- 1 | FROM ascdc/jdk8:latest 2 | 3 | WORKDIR /home 4 | 5 | COPY jars/nacos-rest-consumer-2.2.0.RELEASE.jar /home 6 | COPY startConsumer.sh /home 7 | 8 | RUN chmod -R 777 /home 9 | EXPOSE 8004 5009 10 | ENTRYPOINT ["sh", "/home/startConsumer.sh"] 11 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/providerDockerfile: -------------------------------------------------------------------------------- 1 | FROM ascdc/jdk8:latest 2 | 3 | WORKDIR /home 4 | 5 | COPY jars/nacos-rest-provider-2.2.0.RELEASE.jar /home 6 | COPY startProvider.sh /home 7 | 8 | RUN chmod -R 777 /home 9 | EXPOSE 8004 5009 10 | ENTRYPOINT ["sh", "/home/startProvider.sh"] 11 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-a/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: dubbo-a 4 | server: 5 | port: 28020 6 | dubbo: 7 | application: 8 | name: dubbo-a 9 | protocol: 10 | port: 28820 11 | name: dubbo 12 | registry: 13 | address: sc://127.0.0.1:30100 -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8004 3 | grace: 4 | providerName: nacos-rest-data 5 | spring: 6 | application: 7 | name: nacos-rest-provider 8 | cloud: 9 | nacos: 10 | discovery: 11 | server-addr: localhost:8848 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question_consult.yaml: -------------------------------------------------------------------------------- 1 | name: Question consulting 2 | description: Provide detailed problem information 3 | labels: kind/question 4 | body: 5 | - type: textarea 6 | id: question 7 | attributes: 8 | label: What do you want to ask? 9 | description: | 10 | I want to consult xxx. 11 | validations: 12 | required: true 13 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8005 3 | grace: 4 | openProviderName: nacos-rest-provider 5 | closeProviderName: nacos-rest-provider-close-grace 6 | spring: 7 | application: 8 | name: nacos-rest-consumer 9 | cloud: 10 | nacos: 11 | discovery: 12 | server-addr: localhost:8848 -------------------------------------------------------------------------------- /registry-demo/springboot-registry-demo/service-a/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: service-a 4 | server: 5 | port: 8005 6 | 7 | config: 8 | domain: www.domain.com 9 | downStreamB: service-b 10 | downStreamC: service-c 11 | sleepMs: 1 12 | gateWayPort: 9000 13 | timeout: 2600 14 | port1: 8206 15 | port2: 8207 16 | futureTimeout: 10 17 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 28820 3 | dubbo: 4 | application: 5 | name: dubbo-registry-consumer 6 | registry: 7 | # 模拟存量dubbo应用注册到zookeeper的情况,新开发的应用建议配置为 sc://127.0.0.1:30100 8 | address: zookeeper://127.0.0.1:2181 9 | protocol: zookeeper 10 | 11 | spring: 12 | application: 13 | name: dubbo-registry-consumer -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-provider/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 28021 3 | dubbo: 4 | protocol: 5 | port: ${DUBBO_PROTOCOL_PORT:28821} 6 | 7 | spring: 8 | application: 9 | name: dubbo-integration-provider 10 | 11 | feign: 12 | hystrix: 13 | enabled: true 14 | 15 | management: 16 | endpoint: 17 | health: 18 | probes: 19 | enabled: true 20 | timeout: 0 -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | 4 | spring: 5 | application: 6 | name: consumer 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: consumer 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /monitor-demo/src/main/java/com/example/demo/MonitorDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MonitorDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MonitorDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerA/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8002 3 | 4 | spring: 5 | application: 6 | name: providerA 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: providerA 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerB/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8004 3 | 4 | spring: 5 | application: 6 | name: providerB 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: providerB 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /xds-demo/product/script/spring-server-destination.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: spring-server-destinationrule-robin 5 | spec: 6 | host: spring-server.default.svc.cluster.local 7 | trafficPolicy: 8 | loadBalancer: 9 | simple: ROUND_ROBIN 10 | subsets: 11 | - name: v1 12 | labels: 13 | version: v1 14 | - name: v2 15 | labels: 16 | version: v2 -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerA-gray/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8003 3 | 4 | spring: 5 | application: 6 | name: providerA 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: providerA 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerB-gray/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8005 3 | 4 | spring: 5 | application: 6 | name: providerB 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: providerB 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/consul-consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | 4 | spring: 5 | application: 6 | name: consumer 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: consumer 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/consul-provider/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8002 3 | 4 | spring: 5 | application: 6 | name: provider 7 | cloud: 8 | consul: 9 | host: 127.0.0.1 10 | port: 8500 11 | discovery: 12 | service-name: provider 13 | heartbeat: 14 | enabled: true 15 | instanceZone: A 16 | catalog-services-watch: 17 | enabled: false -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-provider/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 28021 3 | dubbo: 4 | application: 5 | name: dubbo-registry-provider 6 | protocol: 7 | port: 28821 8 | name: dubbo 9 | registry: 10 | # 模拟存量dubbo应用注册到zookeeper的情况,新开发的应用建议配置为 sc://127.0.0.1:30100 11 | address: zookeeper://127.0.0.1:2181 12 | protocol: zookeeper 13 | 14 | 15 | spring: 16 | application: 17 | name: dubbo-registry-provider -------------------------------------------------------------------------------- /tag-transmission-demo/http-client-demo/src/main/java/com/huaweicloud/tag/demo/ClientDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.tag.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ClientDemoApplication { 8 | public static void main(String[] args) { 9 | SpringApplication.run(ClientDemoApplication.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tag-transmission-demo/http-server-demo/src/main/java/com/huaweicloud/tag/demo/ServerDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.tag.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ServerDemoApplication { 8 | public static void main(String[] args) { 9 | SpringApplication.run(ServerDemoApplication.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /xds-demo/spring-cloud-client-xds/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-client 4 | cloud: 5 | zookeeper: 6 | connect-string: ${ZOOKEEPER_IP}:2181 7 | enabled: ${ZOOKEEPER_ENABLED:false} 8 | server: 9 | port: 8080 10 | mysql: 11 | address: jdbc:mariadb://mysql.default.svc.cluster.local:3306/test?useSSL=false&allowPublicKeyRetrieval=true 12 | user: ${MYSQL_USER:root} 13 | password: ${MYSQL_PASSWORD:} 14 | enabled: ${MYSQL_ENABLED:false} -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/spring-cloud-registry-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-cloud-registry-consumer 4 | cloud: 5 | zookeeper: 6 | connect-string: localhost:2181 7 | 8 | server: 9 | port: 8161 10 | 11 | hystrix: 12 | command: 13 | default: 14 | execution: 15 | isolation: 16 | thread: 17 | timeoutInMilliseconds: 50000 18 | 19 | ribbon: 20 | ConnectTimeout: 10000 21 | ReadTimeout: 10000 -------------------------------------------------------------------------------- /first-plugin-demo/application/src/main/java/com/huaweicloud/template/Application.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.template; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * 模版应用 8 | * 9 | * @author luanwenfei 10 | * @since 2023-01-15 11 | */ 12 | @SpringBootApplication 13 | public class Application { 14 | public static void main(String[] args) { 15 | SpringApplication.run(Application.class, args); 16 | } 17 | } -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/spring-cloud-gateway/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: gateway 4 | cloud: 5 | gateway: 6 | discovery: 7 | locator: 8 | enable: true 9 | lowerCaseServiceIdd: true 10 | default-filters: 11 | - StripPrefix=1 12 | 13 | server: 14 | port: 28030 15 | dubbo: 16 | application: 17 | name: gateway 18 | protocol: 19 | name: dubbo 20 | port: 28830 21 | registry: 22 | address: sc://127.0.0.1:30100 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.yaml: -------------------------------------------------------------------------------- 1 | name: Enhancement Tracking Issue 2 | description: Provide supporting details for a feature in development 3 | labels: kind/feature 4 | body: 5 | - type: textarea 6 | id: feature 7 | attributes: 8 | label: What would you like to be added? 9 | description: | 10 | I want to enhance xxx. 11 | validations: 12 | required: true 13 | 14 | - type: textarea 15 | id: rationale 16 | attributes: 17 | label: Why is this needed? 18 | validations: 19 | required: true -------------------------------------------------------------------------------- /xds-demo/product/script/spring-server-virtureservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: spring-server-virtualservice 5 | spec: 6 | hosts: 7 | - spring-server 8 | http: 9 | - name: "v1-routes" 10 | match: 11 | - headers: 12 | version: 13 | exact: v1 14 | uri: 15 | exact: /router 16 | ignoreUriCase: false 17 | route: 18 | - destination: 19 | host: spring-server 20 | subset: v1 21 | port: 22 | number: 8081 -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/consul-provider/src/main/java/com/cloud/demos/ProviderController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestParam; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class ProviderController { 9 | 10 | @GetMapping("/sayHello") 11 | public String sayHello(@RequestParam("name") String name) { 12 | return "Hello:name---" + name; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/consul-provider/src/main/java/com/cloud/demos/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class ProviderApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(ProviderApplication.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/k8s/consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: dubbo-a 5 | labels: 6 | app: dubbo-a 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: dubbo-a 12 | template: 13 | metadata: 14 | labels: 15 | app: dubbo-a 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: dubbo-a 20 | image: dubbo-a:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/k8s/provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: dubbo-b 5 | labels: 6 | app: dubbo-b 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: dubbo-b 12 | template: 13 | metadata: 14 | labels: 15 | app: dubbo-b 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: dubbo-b 20 | image: dubbo-b:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-provider/src/main/java/com/cloud/demos/EurekaProviderController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestParam; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class EurekaProviderController { 9 | 10 | @GetMapping("/sayHello") 11 | public String sayEurekaHello(@RequestParam("name") String name) { 12 | return "Hello:name---" + name; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-server/src/main/java/com/cloud/demos/EurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaServerApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(EurekaServerApplication.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/k8s/consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: consumer 5 | labels: 6 | app: consumer 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: consumer 12 | template: 13 | metadata: 14 | labels: 15 | app: consumer 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: consumer 20 | image: consumer:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-consumer/src/main/java/com/cloud/demos/EurekaConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class EurekaConsumerApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(EurekaConsumerApplication.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-provider/src/main/java/com/cloud/demos/EurekaProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class EurekaProviderApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(EurekaProviderApplication.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /first-plugin-demo/application/src/main/java/com/huaweicloud/template/Controller.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.template; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * 服务端接口 8 | * 9 | * @author daizhenyu 10 | * @since 2023-10-19 11 | **/ 12 | @RestController 13 | public class Controller { 14 | @RequestMapping("sayHello") 15 | public void sayHello(String name) throws InterruptedException { 16 | System.out.println("hello " + name); 17 | Thread.sleep(10); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/k8s/consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: consumer 5 | labels: 6 | app: consumer 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: consumer 12 | template: 13 | metadata: 14 | labels: 15 | app: consumer 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: consumer 20 | image: consumer:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/deployment/k8s/provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: provider 5 | labels: 6 | app: provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: provider 12 | template: 13 | metadata: 14 | labels: 15 | app: provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: provider 20 | image: provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/k8s/consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: consumer 5 | labels: 6 | app: consumer 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: consumer 12 | template: 13 | metadata: 14 | labels: 15 | app: consumer 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: consumer 20 | image: consumer:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/deployment/k8s/provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: provider 5 | labels: 6 | app: provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: provider 12 | template: 13 | metadata: 14 | labels: 15 | app: provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: provider 20 | image: provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-cloud-router-consumer 4 | 5 | server: 6 | port: 8161 7 | 8 | feign: 9 | hystrix: 10 | enabled: true 11 | client: 12 | config: 13 | default: 14 | connectTimeout: 5000 15 | readTimeout: 10000 16 | 17 | hystrix: 18 | command: 19 | default: 20 | execution: 21 | isolation: 22 | thread: 23 | timeoutInMilliseconds: 50000 24 | 25 | ribbon: 26 | ConnectTimeout: 10000 27 | ReadTimeout: 10000 -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-zuul/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: spring-cloud-router-zuul 4 | 5 | server: 6 | port: 8170 7 | 8 | feign: 9 | hystrix: 10 | enabled: true 11 | 12 | zuul: 13 | routes: 14 | spring-cloud-router-consumer: /consumer/** 15 | spring-cloud-router-provider: /provider/** 16 | 17 | hystrix: 18 | command: 19 | default: 20 | execution: 21 | isolation: 22 | thread: 23 | timeoutInMilliseconds: 50000 24 | 25 | ribbon: 26 | ConnectTimeout: 10000 27 | ReadTimeout: 10000 -------------------------------------------------------------------------------- /first-plugin-demo/config/plugins.yaml: -------------------------------------------------------------------------------- 1 | # premain启动会加载plugins下配置的插件目录, agentmain启动会加载dynamicPlugins下的active插件目录 2 | # 插件的加载顺序如下: 3 | # 1. 首先按照`plugins`中配置的插件顺序来加载默认插件。 4 | # 2. 然后再按照`profile`配置的场景顺序来加载场景插件列表, 各场景的插件加载顺序也和配置文件中的顺序一致。 5 | # 3. 如果`profiles`中的配置的插件已经在之前加载过, 则不再重复加载。 6 | # 4. 不同插件的相同拦截点的字节码增强的生效顺序与插件加载顺序是一致的。 7 | # plugins用于配置静态插件, premain启动时生效, 配置支持静态安装的插件, 不允许卸载 8 | plugins: 9 | - template 10 | # dynamicPlugins用于配置支持动态安装的插件, agentmain启动时生效, 允许卸载: 11 | # 1. active类型插件将会主动启用 12 | # 2. passive类型插件需通过指令或接口调用启用 13 | dynamicPlugins: 14 | active: 15 | # - active-plugin 16 | passive: 17 | # - passive-plugin 18 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/k8s/provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-provider 5 | labels: 6 | app: spring-provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: spring-provider 12 | template: 13 | metadata: 14 | labels: 15 | app: spring-provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: spring-provider 20 | image: spring-provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret 24 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-demo-common/src/main/java/com/huawei/dubbotest/service/ATest.java: -------------------------------------------------------------------------------- 1 | package com.huawei.dubbotest.service; 2 | 3 | import com.huawei.dubbotest.domain.Test; 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public interface ATest { 9 | Map testEmpty(long id, String name); 10 | 11 | Map testObject(Test test); 12 | 13 | Map testEnabled(Test test); 14 | 15 | Map testArray(String[] array); 16 | 17 | Map testList(List list); 18 | 19 | Map testMap(Map map); 20 | } 21 | -------------------------------------------------------------------------------- /xds-demo/product/script/spring-server-virtureservice-flowcontrol.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: spring-server-virtualservice 5 | spec: 6 | hosts: 7 | - spring-server 8 | http: 9 | - name: "v1-routes" 10 | match: 11 | - headers: 12 | version: 13 | exact: v1 14 | uri: 15 | exact: /router 16 | ignoreUriCase: false 17 | route: 18 | - destination: 19 | host: spring-server 20 | subset: v1 21 | port: 22 | number: 8081 23 | fault: 24 | abort: 25 | percentage: 26 | value: 100 27 | httpStatus: 400 -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/k8s/dubbo-registry-provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: dubbo-registry-provider 5 | labels: 6 | app: dubbo-registry-provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: dubbo-registry-provider 12 | template: 13 | metadata: 14 | labels: 15 | app: dubbo-registry-provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: dubbo-registry-provider 20 | image: dubbo-registry-provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /tag-transmission-demo/http-server-demo/src/main/java/com/huaweicloud/tag/demo/ServerController.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.tag.demo; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | /** 9 | * ServerController 10 | * 11 | * @author lilai 12 | * @since 2023-09-23 13 | */ 14 | @RestController 15 | public class ServerController { 16 | @GetMapping("/hello") 17 | public String hello(HttpServletRequest request) { 18 | return "Hello World! This is HTTP server. Received Traffic Tag is [ id : " + request.getHeader("id") + "]"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | com.nacos.demo 7 | 1.0.0 8 | nacos-common 9 | jar 10 | 11 | 8 12 | 8 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/k8s/spring-cloud-router-consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-cloud-router-consumer 5 | labels: 6 | app: spring-cloud-router-consumer 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: spring-cloud-router-consumer 12 | template: 13 | metadata: 14 | labels: 15 | app: spring-cloud-router-consumer 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: spring-cloud-router-consumer 20 | image: spring-cloud-router-consumer:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/k8s/spring-cloud-router-provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-cloud-router-provider 5 | labels: 6 | app: spring-cloud-router-provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: spring-cloud-router-provider 12 | template: 13 | metadata: 14 | labels: 15 | app: spring-cloud-router-provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: spring-cloud-router-provider 20 | image: spring-cloud-router-provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-consumer/src/main/resources/dubbo/consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerB/src/main/java/com/cloud/demos/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDiscoveryClient 12 | public class ProviderApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(ProviderApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/k8s/spring-cloud-registry-provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-cloud-registry-provider 5 | labels: 6 | app: spring-cloud-registry-provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: spring-cloud-registry-provider 12 | template: 13 | metadata: 14 | labels: 15 | app: spring-cloud-registry-provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: spring-cloud-registry-provider 20 | image: spring-cloud-registry-provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | imagePullSecrets: 23 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerB-gray/src/main/java/com/cloud/demos/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDiscoveryClient 12 | public class ProviderApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(ProviderApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-consumer/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 28020 3 | dubbo: 4 | protocol: 5 | port: ${DUBBO_PROTOCOL_PORT:28820} 6 | 7 | spring: 8 | application: 9 | name: dubbo-integration-consumer 10 | 11 | feign: 12 | hystrix: 13 | enabled: true 14 | client: 15 | config: 16 | default: 17 | connectTimeout: 5000 18 | readTimeout: 10000 19 | 20 | hystrix: 21 | command: 22 | default: 23 | execution: 24 | isolation: 25 | thread: 26 | timeoutInMilliseconds: 10000 27 | 28 | ribbon: 29 | ConnectTimeout: 10000 30 | ReadTimeout: 10000 31 | 32 | management: 33 | endpoint: 34 | health: 35 | probes: 36 | enabled: true -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/k8s/providerA.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: providerA 5 | labels: 6 | app: providerA 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: providerA 12 | template: 13 | metadata: 14 | labels: 15 | app: providerA 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: providerA 20 | image: providerA:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | env: 23 | - name: "SERVICE_META_VERSION" 24 | value: "1.0.0" 25 | - name: "SERVICE_META_PARAMETERS" 26 | value: "group:base" 27 | imagePullSecrets: 28 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/k8s/providerB.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: providerB 5 | labels: 6 | app: providerB 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: providerB 12 | template: 13 | metadata: 14 | labels: 15 | app: providerB 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: providerB 20 | image: providerB:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | env: 23 | - name: "SERVICE_META_VERSION" 24 | value: "1.0.0" 25 | - name: "SERVICE_META_PARAMETERS" 26 | value: "group:base" 27 | imagePullSecrets: 28 | - name: default-secret -------------------------------------------------------------------------------- /first-plugin-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | io.sermant 5 | first-plugin-demo 6 | 2.0.0 7 | 8 | pom 9 | 10 | 11 | 8 12 | 8 13 | 14 | 15 | template 16 | application 17 | 18 | 19 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/k8s/gray-provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: gray-dubbo-b 5 | labels: 6 | app: gray-dubbo-b 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: gray-dubbo-b 12 | template: 13 | metadata: 14 | labels: 15 | app: gray-dubbo-b 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: gray-dubbo-b 20 | image: dubbo-b:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | env: 23 | - name: "SERVICE_META_VERSION" 24 | value: "1.0.1" 25 | - name: "SERVICE_META_PARAMETERS" 26 | value: "group:gray" 27 | imagePullSecrets: 28 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/consumer/src/main/java/com/cloud/demos/ConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | @RestController 10 | public class ConsumerController { 11 | 12 | @Autowired 13 | private RestTemplate restTemplate; 14 | 15 | @GetMapping("/sayHello") 16 | public String sayHello(@RequestParam("name") String name) { 17 | return restTemplate.getForObject("http://providerA/sayHello?name={1}", String.class, name); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | dubbo-registry-demo 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | dubbo-registry-api 13 | 14 | 15 | 8 16 | 8 17 | 18 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-provider/src/main/resources/dubbo/provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/k8s/providerA-gray.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: providerA-gray 5 | labels: 6 | app: providerA-gray 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: providerA-gray 12 | template: 13 | metadata: 14 | labels: 15 | app: providerA-gray 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: providerA-gray 20 | image: providerA-gray:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | env: 23 | - name: "SERVICE_META_VERSION" 24 | value: "2.0.0" 25 | - name: "SERVICE_META_PARAMETERS" 26 | value: "group:gray" 27 | imagePullSecrets: 28 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/deployment/k8s/providerB-gray.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: providerB-gray 5 | labels: 6 | app: providerB-gray 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: providerB-gray 12 | template: 13 | metadata: 14 | labels: 15 | app: providerB-gray 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: providerB-gray 20 | image: providerB-gray:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | env: 23 | - name: "SERVICE_META_VERSION" 24 | value: "2.0.0" 25 | - name: "SERVICE_META_PARAMETERS" 26 | value: "group:gray" 27 | imagePullSecrets: 28 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/consul-consumer/src/main/java/com/cloud/demos/ConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | @RestController 10 | public class ConsumerController { 11 | 12 | @Autowired 13 | private RestTemplate restTemplate; 14 | 15 | @GetMapping("/sayHello") 16 | public String sayHello(@RequestParam("name") String name) { 17 | return restTemplate.getForObject("http://provider/sayHello?name={1}", String.class, name); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/eureka-consumer/src/main/java/com/cloud/demos/EurekaConsumerController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | @RestController 10 | public class EurekaConsumerController { 11 | 12 | @Autowired 13 | private RestTemplate restTemplate; 14 | 15 | @GetMapping("/sayHello") 16 | public String sayEurekaHello(@RequestParam("name") String name) { 17 | return restTemplate.getForObject("http://provider/sayHello?name={1}", String.class, name); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/startData.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # 19 | 20 | exec java $OTHER_VM_OPTIONS -jar /home/nacos-rest-data-2.2.0.RELEASE.jar 21 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/startConsumer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # 19 | 20 | exec java $OTHER_VM_OPTIONS -jar /home/nacos-rest-consumer-2.2.0.RELEASE.jar 21 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/startProvider.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # 19 | 20 | exec java $OTHER_VM_OPTIONS -jar /home/nacos-rest-provider-2.2.0.RELEASE.jar 21 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/consumer/src/main/java/com/cloud/demos/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDiscoveryClient 12 | public class ConsumerApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(ConsumerApplication.class, args); 15 | } 16 | 17 | @LoadBalanced 18 | @Bean 19 | public RestTemplate restTemplate() { 20 | return new RestTemplate(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerA/src/main/java/com/cloud/demos/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDiscoveryClient 12 | public class ProviderApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(ProviderApplication.class, args); 15 | } 16 | 17 | @LoadBalanced 18 | @Bean 19 | public RestTemplate restTemplate() { 20 | return new RestTemplate(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/spring-cloud-gateway/src/main/resources/dubbo/consumer.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerA-gray/src/main/java/com/cloud/demos/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDiscoveryClient 12 | public class ProviderApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(ProviderApplication.class, args); 15 | } 16 | 17 | @LoadBalanced 18 | @Bean 19 | public RestTemplate restTemplate() { 20 | return new RestTemplate(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-demo-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | dubbo-router-demo 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | dubbo-demo-common 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | ${project.artifactId} 21 | 22 | -------------------------------------------------------------------------------- /mq-gray-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | sermant-examples 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | mq-gray-demo 13 | 14 | 15 | rocketmq-gray-demo 16 | 17 | 18 | pom 19 | 20 | 21 | 8 22 | 8 23 | 24 | 25 | -------------------------------------------------------------------------------- /database-write-prohibition-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | sermant-examples 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | pom 12 | 13 | mongodb-demo 14 | 15 | database-write-prohibition-demo 16 | 17 | 18 | 8 19 | 8 20 | 21 | -------------------------------------------------------------------------------- /mq-consume-prohibition-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | sermant-examples 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | mq-consume-prohibition-demo 13 | pom 14 | 15 | kafka-demo 16 | 17 | 18 | 19 | 8 20 | 8 21 | 22 | 23 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/consul-consumer/src/main/java/com/cloud/demos/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @SpringBootApplication 11 | @EnableDiscoveryClient 12 | public class ConsumerApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(ConsumerApplication.class, args); 15 | } 16 | 17 | @LoadBalanced 18 | @Bean 19 | public RestTemplate restTemplate() { 20 | return new RestTemplate(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/buildData.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | # 3 | # Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # 18 | 19 | version=1.0.2 20 | name=data 21 | dockerFile=dataDockerfile 22 | imageName=$name:$version 23 | docker build -f $dockerFile -t $imageName . 24 | docker push $imageName 25 | -------------------------------------------------------------------------------- /router-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | sermant-examples 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 11 | 4.0.0 12 | 13 | router-demo 14 | pom 15 | 16 | dubbo-router-demo 17 | spring-cloud-router-demo 18 | 19 | 20 | 21 | 8 22 | 8 23 | 24 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | # 3 | # Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # 18 | 19 | version=1.0.2 20 | name=provider 21 | dockerFile=providerDockerfile 22 | imageName=$name:$version 23 | docker build -f $dockerFile -t $imageName . 24 | docker push $imageName 25 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/image/buildConsumer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash; 2 | # 3 | # Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # 18 | 19 | version=1.0.2 20 | name=consumer 21 | dockerFile=consumerDockerfile 22 | imageName=$name:$version 23 | docker build -f $dockerFile -t $imageName . 24 | docker push $imageName 25 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/k8s/spring-cloud-router-gray-provider.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-cloud-router-gray-provider 5 | labels: 6 | app: spring-cloud-router-gray-provider 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: spring-cloud-router-gray-provider 12 | template: 13 | metadata: 14 | labels: 15 | app: spring-cloud-router-gray-provider 16 | sermant-injection: enabled 17 | spec: 18 | containers: 19 | - name: spring-cloud-router-gray-provider 20 | image: spring-cloud-router-provider:1.0.0 21 | imagePullPolicy: IfNotPresent 22 | env: 23 | - name: "SERVICE_META_VERSION" 24 | value: "1.0.1" 25 | - name: "SERVICE_META_PARAMETERS" 26 | value: "group:gray" 27 | imagePullSecrets: 28 | - name: default-secret -------------------------------------------------------------------------------- /tag-transmission-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | sermant-examples 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | tag-transmission-demo 13 | 14 | 15 | http-client-demo 16 | http-server-demo 17 | 18 | 19 | pom 20 | 21 | 22 | 8 23 | 8 24 | 25 | 26 | -------------------------------------------------------------------------------- /xds-demo/product/script/mysql.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mysql 5 | namespace: default 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: mysql 11 | template: 12 | metadata: 13 | labels: 14 | app: mysql 15 | spec: 16 | containers: 17 | - name: mysql 18 | image: mysql:8.0.40 19 | env: 20 | # please fill in the password of the root user 21 | - name: MYSQL_ROOT_PASSWORD 22 | value: "" 23 | ports: 24 | - containerPort: 3306 25 | securityContext: 26 | privileged: true 27 | --- 28 | apiVersion: v1 29 | kind: Service 30 | metadata: 31 | name: mysql 32 | namespace: default 33 | spec: 34 | selector: 35 | app: mysql 36 | ports: 37 | - protocol: TCP 38 | port: 3306 39 | targetPort: 3306 40 | nodePort: 30036 41 | type: NodePort -------------------------------------------------------------------------------- /mq-consume-prohibition-demo/kafka-demo/src/main/java/com/huaweicloud/mq/demo/KafkaDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.mq.demo; 2 | 3 | import org.apache.kafka.clients.consumer.KafkaConsumer; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | import java.util.Collections; 8 | 9 | /** 10 | * 启动类 11 | * 12 | * @author lilai 13 | * @since 2023-12-25 14 | */ 15 | @SpringBootApplication 16 | public class KafkaDemoApplication { 17 | public static void main(String[] args) throws InterruptedException { 18 | SpringApplication.run(KafkaDemoApplication.class, args); 19 | KafkaConsumer consumer = KafkaConsumerManager.getInstance().getConsumer(); 20 | consumer.subscribe(Collections.singleton("demo-test-topic")); 21 | while (true) { 22 | consumer.poll(2000); 23 | Thread.sleep(2000); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-consul-registry-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.huaweicloud.sermant.examples 8 | spring-cloud-consul-registry-demo 9 | 1.0.0 10 | pom 11 | 12 | spring-cloud-consul-registry-demo 13 | 14 | 15 | UTF-8 16 | 1.8 17 | 1.8 18 | 19 | 20 | 21 | consul-consumer 22 | consul-provider 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-eureka-registry-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.huaweicloud.sermant.examples 8 | spring-cloud-eureka-registry-demo 9 | 1.0.0 10 | pom 11 | 12 | spring-cloud-eureka-registry-demo 13 | 14 | 15 | UTF-8 16 | 1.8 17 | 1.8 18 | 19 | 20 | 21 | eureka-consumer 22 | eureka-provider 23 | eureka-server 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.huaweicloud.sermant.examples 8 | full-link-route-demo 9 | 1.0.0 10 | pom 11 | 12 | full-link-route-demo 13 | 14 | 15 | UTF-8 16 | 1.8 17 | 1.8 18 | 19 | 20 | 21 | consumer 22 | providerA 23 | providerA-gray 24 | providerB 25 | providerB-gray 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/deployment/k8s/spring-cloud-getaway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: spring-cloud-gateway 5 | labels: 6 | app: spring-cloud-gateway 7 | spec: 8 | type: NodePort 9 | ports: 10 | - port: 28030 11 | nodePort: 30000 12 | name: spring-cloud-gateway 13 | selector: 14 | app: spring-cloud-gateway 15 | --- 16 | apiVersion: apps/v1 17 | kind: Deployment 18 | metadata: 19 | name: spring-cloud-gateway 20 | labels: 21 | app: spring-cloud-gateway 22 | spec: 23 | replicas: 1 24 | selector: 25 | matchLabels: 26 | app: spring-cloud-gateway 27 | template: 28 | metadata: 29 | labels: 30 | app: spring-cloud-gateway 31 | sermant-injection: enabled 32 | spec: 33 | containers: 34 | - name: spring-cloud-gateway 35 | image: spring-cloud-gateway:1.0.0 36 | imagePullPolicy: IfNotPresent 37 | ports: 38 | - containerPort: 28030 39 | imagePullSecrets: 40 | - name: default-secret -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-a/src/main/resources/dubbo/provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-b/src/main/resources/dubbo/provider.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/deployment/k8s/spring-cloud-router-zuul.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: spring-cloud-router-zuul 5 | labels: 6 | app: spring-cloud-router-zuul 7 | spec: 8 | type: NodePort 9 | ports: 10 | - port: 8170 11 | nodePort: 30000 12 | name: zuul-test 13 | selector: 14 | app: spring-cloud-router-zuul 15 | --- 16 | apiVersion: apps/v1 17 | kind: Deployment 18 | metadata: 19 | name: spring-cloud-router-zuul 20 | labels: 21 | app: spring-cloud-router-zuul 22 | spec: 23 | replicas: 1 24 | selector: 25 | matchLabels: 26 | app: spring-cloud-router-zuul 27 | template: 28 | metadata: 29 | labels: 30 | app: spring-cloud-router-zuul 31 | sermant-injection: enabled 32 | spec: 33 | containers: 34 | - name: spring-cloud-router-zuul 35 | image: spring-cloud-router-zuul:1.0.0 36 | imagePullPolicy: IfNotPresent 37 | ports: 38 | - containerPort: 8170 39 | imagePullSecrets: 40 | - name: default-secret -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/deployment/k8s/dubbo-registry-consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: dubbo-registry-consumer 5 | labels: 6 | app: dubbo-registry-consumer 7 | spec: 8 | type: NodePort 9 | ports: 10 | - port: 28820 11 | nodePort: 30000 12 | name: dubbo-registry-consumer-test 13 | selector: 14 | app: dubbo-registry-consumer 15 | --- 16 | apiVersion: apps/v1 17 | kind: Deployment 18 | metadata: 19 | name: dubbo-registry-consumer 20 | labels: 21 | app: dubbo-registry-consumer 22 | spec: 23 | replicas: 1 24 | selector: 25 | matchLabels: 26 | app: dubbo-registry-consumer 27 | template: 28 | metadata: 29 | labels: 30 | app: dubbo-registry-consumer 31 | sermant-injection: enabled 32 | spec: 33 | containers: 34 | - name: dubbo-registry-consumer 35 | image: dubbo-registry-consumer:1.0.0 36 | imagePullPolicy: IfNotPresent 37 | ports: 38 | - containerPort: 28820 39 | imagePullSecrets: 40 | - name: default-secret -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/service/RemovalService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | /** 20 | * 离群实例摘除测试接口 21 | * 22 | * @author zhp 23 | * @since 2023-03-16 24 | */ 25 | public interface RemovalService { 26 | /** 27 | * 获取端口号 28 | * 29 | * @return 测试信息 30 | */ 31 | String getPort(); 32 | } -------------------------------------------------------------------------------- /loadbalancer-demo/resttemplate-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | loadbalancer-demo 7 | com.huaweicloud.sermant 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | resttemplate-provider 13 | 14 | 8 15 | 8 16 | 17 | 18 | 19 | ${artifactId} 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-maven-plugin 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-api/src/main/java/com/huaweicloud/examples/registry/api/HelloService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry.api; 18 | 19 | /** 20 | * 测试接口 21 | * 22 | * @author provenceee 23 | * @since 2022-08-29 24 | */ 25 | public interface HelloService { 26 | /** 27 | * 测试接口 28 | * 29 | * @return 测试信息 30 | */ 31 | String hello(); 32 | } -------------------------------------------------------------------------------- /loadbalancer-demo/resttemplate-consumer/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | loadbalancer-demo 7 | com.huaweicloud.sermant 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | resttemplate-consumer 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | ${artifactId} 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-maven-plugin 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /registry-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | sermant-examples 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | registry-demo 13 | pom 14 | 15 | dubbo-registry-demo 16 | spring-cloud-registry-demo 17 | springboot-registry-demo 18 | spring-cloud-consul-registry-demo 19 | spring-cloud-eureka-registry-demo 20 | 21 | 22 | 23 | 8 24 | 8 25 | 26 | 27 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-provider/src/main/java/com/huaweicloud/integration/service/BarServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | /** 20 | * 测试接口 21 | * 22 | * @author provenceee 23 | * @since 2022-04-28 24 | */ 25 | public class BarServiceImpl implements BarService { 26 | @Override 27 | public String bar(String str) { 28 | return "bar1:" + str; 29 | } 30 | } -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/service/BarService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | /** 20 | * 测试接口 21 | * 22 | * @author provenceee 23 | * @since 2022-04-28 24 | */ 25 | public interface BarService { 26 | /** 27 | * 测试接口 28 | * 29 | * @param str 参数 30 | * @return 测试信息 31 | */ 32 | String bar(String str); 33 | } -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-provider/src/main/java/com/huaweicloud/integration/service/Bar2ServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | /** 20 | * 测试接口 21 | * 22 | * @author provenceee 23 | * @since 2022-04-28 24 | */ 25 | public class Bar2ServiceImpl implements BarService { 26 | @Override 27 | public String bar(String str) { 28 | return "bar2:" + str; 29 | } 30 | } -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/development/k8s/consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: spring-consumer 5 | labels: 6 | app: spring-consumer 7 | spec: 8 | type: NodePort 9 | ports: 10 | - port: 8005 11 | nodePort: 31001 12 | name: request 13 | selector: 14 | app: spring-consumer 15 | --- 16 | apiVersion: apps/v1 17 | kind: Deployment 18 | metadata: 19 | name: spring-consumer 20 | labels: 21 | app: spring-consumer 22 | spec: 23 | replicas: 1 24 | selector: 25 | matchLabels: 26 | app: spring-consumer 27 | template: 28 | metadata: 29 | labels: 30 | app: spring-consumer 31 | sermant-injection: enabled 32 | spec: 33 | containers: 34 | - name: spring-consumer 35 | image: spring-consumer:1.0.0 36 | imagePullPolicy: IfNotPresent 37 | ports: 38 | - containerPort: 8005 39 | # 若遇到域名无法解析问题,请将下面的配置开启 40 | # env: 41 | # - name: "servicecomb_service_preferIpAddress" 42 | # value: "true" 43 | imagePullSecrets: 44 | - name: default-secret 45 | -------------------------------------------------------------------------------- /removal-demo/rest-consumer/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.huaweicloud.sermant 8 | removal-demo 9 | 1.0.0 10 | 11 | 12 | rest-consumer 13 | 14 | 15 | 8 16 | 8 17 | UTF-8 18 | 19 | 20 | 21 | ${artifactId} 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-maven-plugin 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /removal-demo/rest-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.huaweicloud.sermant 8 | removal-demo 9 | 1.0.0 10 | 11 | 12 | rest-provider 13 | 14 | 15 | 8 16 | 8 17 | UTF-8 18 | 19 | 20 | 21 | ${artifactId} 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-maven-plugin 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/service/FlowControlVersionService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | /** 20 | * 标记版本 21 | * 22 | * @author zhouss 23 | * @since 2022-09-15 24 | */ 25 | public interface FlowControlVersionService extends FlowControlService { 26 | /** 27 | * 限流测试 - 版本匹配 28 | * 29 | * @return 结果 30 | */ 31 | String rateLimitingWithVersion(); 32 | } 33 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/deployment/k8s/spring-cloud-registry-consumer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: spring-cloud-registry-consumer 5 | labels: 6 | app: spring-cloud-registry-consumer 7 | spec: 8 | type: NodePort 9 | ports: 10 | - port: 8161 11 | nodePort: 30000 12 | name: spring-cloud-registry-consumer-test 13 | selector: 14 | app: spring-cloud-registry-consumer 15 | --- 16 | apiVersion: apps/v1 17 | kind: Deployment 18 | metadata: 19 | name: spring-cloud-registry-consumer 20 | labels: 21 | app: spring-cloud-registry-consumer 22 | spec: 23 | replicas: 1 24 | selector: 25 | matchLabels: 26 | app: spring-cloud-registry-consumer 27 | template: 28 | metadata: 29 | labels: 30 | app: spring-cloud-registry-consumer 31 | sermant-injection: enabled 32 | spec: 33 | containers: 34 | - name: spring-cloud-registry-consumer 35 | image: spring-cloud-registry-consumer:1.0.0 36 | imagePullPolicy: IfNotPresent 37 | ports: 38 | - containerPort: 8161 39 | imagePullSecrets: 40 | - name: default-secret -------------------------------------------------------------------------------- /first-plugin-demo/template/template-plugin/src/main/java/io/sermant/template/TemplateDeclarer.java: -------------------------------------------------------------------------------- 1 | package io.sermant.template; 2 | 3 | import io.sermant.core.plugin.agent.declarer.AbstractPluginDeclarer; 4 | import io.sermant.core.plugin.agent.declarer.InterceptDeclarer; 5 | import io.sermant.core.plugin.agent.matcher.ClassMatcher; 6 | import io.sermant.core.plugin.agent.matcher.MethodMatcher; 7 | 8 | /** 9 | * 模板字节码增强声明 10 | * 11 | * @author luanwenfei 12 | * @since 2023-01-15 13 | */ 14 | public class TemplateDeclarer extends AbstractPluginDeclarer { 15 | @Override 16 | public ClassMatcher getClassMatcher() { 17 | // 匹配需要拦截的类,通过全限定名匹配 18 | return ClassMatcher.nameEquals("com.huaweicloud.template.Controller"); 19 | } 20 | 21 | @Override 22 | public InterceptDeclarer[] getInterceptDeclarers(ClassLoader classLoader) { 23 | return new InterceptDeclarer[]{ 24 | // 匹配需要拦截的方法,通过名称进行匹配 25 | InterceptDeclarer.build(MethodMatcher.nameEquals("sayHello"), new TemplateInterceptor()) 26 | }; 27 | } 28 | 29 | @Override 30 | public boolean isEnabled() { 31 | return super.isEnabled(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerB/src/main/java/com/cloud/demos/ProviderController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @RestController 11 | public class ProviderController { 12 | 13 | @Value("${SERVICE_META_VERSION:${service_meta_version:${service.meta.version:1.0.0}}}") 14 | private String version; 15 | 16 | @Value("${SERVICE_META_PARAMETERS:${service_meta_parameters:${service.meta.parameters:}}}") 17 | private String parameters; 18 | 19 | @GetMapping("/sayHello") 20 | public String sayHello(@RequestParam("name") String name) { 21 | System.out.println("ProviderB:name---" + name + "---version----" + version + "-------parameters----" + parameters); 22 | return "ProviderB:name---" + name + "---version---" + version + "---parameters---" + parameters; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerB-gray/src/main/java/com/cloud/demos/ProviderController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @RestController 11 | public class ProviderController { 12 | 13 | @Value("${SERVICE_META_VERSION:${service_meta_version:${service.meta.version:1.0.0}}}") 14 | private String version; 15 | 16 | @Value("${SERVICE_META_PARAMETERS:${service_meta_parameters:${service.meta.parameters:}}}") 17 | private String parameters; 18 | 19 | @GetMapping("/sayHello") 20 | public String sayHello(@RequestParam("name") String name) { 21 | System.out.println("ProviderB-gray:name---" + name + "---version----" + version + "-------parameters----" + parameters); 22 | return "ProviderB-gray:name---" + name + "---version---" + version + "---parameters---" + parameters; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/configuration/LbCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.configuration; 18 | 19 | /** 20 | * 仅缓存单个负载均衡类型, 每次请求拿到后清空 21 | * 22 | * @author zhouss 23 | * @since 2022-09-16 24 | */ 25 | public enum LbCache { 26 | /** 27 | * 单例 28 | */ 29 | INSTANCE; 30 | private String lb; 31 | 32 | public String getLb() { 33 | return lb; 34 | } 35 | 36 | public void setLb(String lb) { 37 | this.lb = lb; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-consumer/src/main/java/com/huawei/nacos/rest/consumer/stat/RequestStat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huawei.nacos.rest.consumer.stat; 19 | 20 | import com.huawei.nacos.rest.consumer.entity.ResponseInfo; 21 | 22 | /** 23 | * 请求统计接口 24 | * 25 | * @author zhouss 26 | * @since 2022-06-20 27 | */ 28 | public interface RequestStat { 29 | /** 30 | * 统计请求 31 | * 32 | * @param throwable 请求异常 33 | * @param responseInfo 响应信息 34 | */ 35 | void stat(Throwable throwable, ResponseInfo responseInfo); 36 | } 37 | -------------------------------------------------------------------------------- /xds-demo/product/script/spring-client.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-client 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: spring-client 10 | template: 11 | metadata: 12 | labels: 13 | app: spring-client 14 | spec: 15 | containers: 16 | - name: spring-client 17 | image: spring-client:1.0.0 18 | imagePullPolicy: Never 19 | ports: 20 | - containerPort: 8080 21 | env: 22 | - name: agent_service_dynamic_config_enable 23 | value: "false" 24 | - name: agent_service_xds_service_enable 25 | value: "true" 26 | - name: router_plugin_enabled_xds_route 27 | value: "true" 28 | - name: ZOOKEEPER_ENABLED 29 | value: "false" 30 | - name: MYSQL_ENABLED 31 | value: "false" 32 | - name: JAVA_TOOL_OPTIONS 33 | value: "-javaagent:/home/agent/sermant-agent.jar" 34 | imagePullSecrets: 35 | - name: default-secret 36 | --- 37 | apiVersion: v1 38 | kind: Service 39 | metadata: 40 | name: spring-client 41 | spec: 42 | type: NodePort 43 | ports: 44 | - port: 8080 45 | targetPort: 8080 46 | nodePort: 30110 47 | selector: 48 | app: spring-client -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerA/src/main/java/com/cloud/demos/ProviderController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @RestController 11 | public class ProviderController { 12 | 13 | @Value("${SERVICE_META_VERSION:${service_meta_version:${service.meta.version:1.0.0}}}") 14 | private String version; 15 | 16 | @Value("${SERVICE_META_PARAMETERS:${service_meta_parameters:${service.meta.parameters:}}}") 17 | private String parameters; 18 | 19 | @Autowired 20 | private RestTemplate restTemplate; 21 | 22 | @GetMapping("/sayHello") 23 | public String sayHello(@RequestParam("name") String name) { 24 | String message = "ProviderA:name---" + name + "---version----" + version + "-------parameters----" + parameters; 25 | System.out.println(message); 26 | return message + restTemplate.getForObject("http://providerB/sayHello?name={1}", String.class, name); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-consumer/src/main/java/com/huawei/nacos/rest/consumer/entity/MyHashMap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huawei.nacos.rest.consumer.entity; 19 | 20 | import com.alibaba.fastjson.JSONObject; 21 | 22 | import java.util.concurrent.ConcurrentHashMap; 23 | 24 | /** 25 | * 自定义toString 26 | * 27 | * @param 值 28 | * @param 键 29 | * @author zhouss 30 | * @since 2022-06-20 31 | */ 32 | public class MyHashMap extends ConcurrentHashMap { 33 | @Override 34 | public String toString() { 35 | return JSONObject.toJSONString(this, true); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /xds-demo/product/script/spring-client-flowcontrol.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: spring-client 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: spring-client 10 | template: 11 | metadata: 12 | labels: 13 | app: spring-client 14 | spec: 15 | containers: 16 | - name: spring-client 17 | image: spring-client:1.0.0 18 | imagePullPolicy: Never 19 | ports: 20 | - containerPort: 8080 21 | env: 22 | - name: agent_service_dynamic_config_enable 23 | value: "false" 24 | - name: agent_service_xds_service_enable 25 | value: "true" 26 | - name: xds_flow_control_config_enable 27 | value: "true" 28 | - name: ZOOKEEPER_ENABLED 29 | value: "false" 30 | - name: MYSQL_ENABLED 31 | value: "false" 32 | - name: JAVA_TOOL_OPTIONS 33 | value: "-javaagent:/home/agent/sermant-agent.jar" 34 | imagePullSecrets: 35 | - name: default-secret 36 | --- 37 | apiVersion: v1 38 | kind: Service 39 | metadata: 40 | name: spring-client 41 | spec: 42 | type: NodePort 43 | ports: 44 | - port: 8080 45 | targetPort: 8080 46 | nodePort: 30110 47 | selector: 48 | app: spring-client -------------------------------------------------------------------------------- /router-demo/full-link-route-demo/providerA-gray/src/main/java/com/cloud/demos/ProviderController.java: -------------------------------------------------------------------------------- 1 | package com.cloud.demos; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | import org.springframework.web.client.RestTemplate; 9 | 10 | @RestController 11 | public class ProviderController { 12 | 13 | @Value("${SERVICE_META_VERSION:${service_meta_version:${service.meta.version:1.0.0}}}") 14 | private String version; 15 | 16 | @Value("${SERVICE_META_PARAMETERS:${service_meta_parameters:${service.meta.parameters:}}}") 17 | private String parameters; 18 | 19 | @Autowired 20 | private RestTemplate restTemplate; 21 | 22 | @GetMapping("/sayHello") 23 | public String sayHello(@RequestParam("name") String name) { 24 | String message = "ProviderA-gray:name---" + name + "---version----" + version + "-------parameters----" + parameters; 25 | System.out.println(message); 26 | return message + restTemplate.getForObject("http://providerB/sayHello?name={1}", String.class, name); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /registry-demo/springboot-registry-demo/service-a/src/main/java/com/huawei/service/a/ServiceAApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.service.a; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * 启动类 24 | * 25 | * @author zhouss 26 | * @since 2022-10-13 27 | */ 28 | @SpringBootApplication 29 | public class ServiceAApplication { 30 | /** 31 | * 启动方法 32 | * 33 | * @param args 参数 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(ServiceAApplication.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/constants/Constant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.constants; 18 | 19 | /** 20 | * 常量 21 | * 22 | * @author provenceee 23 | * @since 2023-03-02 24 | */ 25 | public class Constant { 26 | /** 27 | * dubbo路由标签值 28 | */ 29 | public static final String TAG = "app1"; 30 | 31 | /** 32 | * dubbo路由标签key 33 | */ 34 | public static final String TAG_KEY = "dubbo.tag"; 35 | 36 | /** 37 | * dubbo路由标签key 38 | */ 39 | public static final String LANE_TEST_USER_ID = "x-user-id"; 40 | 41 | private Constant() { 42 | } 43 | } -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-demo-common/src/main/java/com/huawei/dubbotest/service/BTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2021 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.dubbotest.service; 18 | 19 | import com.huawei.dubbotest.domain.Test; 20 | 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | public interface BTest { 25 | Map testEmpty(long id, String name); 26 | 27 | Map testObject(Test test); 28 | 29 | Map testEnabled(Test test); 30 | 31 | Map testArray(String[] array); 32 | 33 | Map testList(List list); 34 | 35 | Map testMap(Map map); 36 | } 37 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-data/src/main/java/com/huawei/nacos/rest/data/NacosDataApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huawei.nacos.rest.data; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | 23 | /** 24 | * 启动类 25 | * 26 | * @author zhouss 27 | * @since 2022-06-17 28 | */ 29 | @SpringBootApplication 30 | public class NacosDataApplication { 31 | 32 | /** 33 | * 启动 34 | * 35 | * @param args 启动参数 36 | */ 37 | public static void main(String[] args) { 38 | SpringApplication.run(NacosDataApplication.class, args); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/service/MetadataService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | /** 20 | * 测试接口 21 | * 22 | * @author provenceee 23 | * @since 2022-11-04 24 | */ 25 | public interface MetadataService { 26 | /** 27 | * 获取metadata 28 | * 29 | * @return metadata 30 | */ 31 | String getMetadataByDubbo(); 32 | 33 | /** 34 | * 获取metadata 35 | * 36 | * @return metadata 37 | */ 38 | String getMetadataByFeign(); 39 | 40 | /** 41 | * 获取metadata 42 | * 43 | * @return metadata 44 | */ 45 | String getMetadataByRest(); 46 | } -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-provider/src/main/java/com/huaweicloud/examples/router/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.router; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * 启动类 24 | * 25 | * @author provenceee 26 | * @since 2022-07-26 27 | */ 28 | @SpringBootApplication 29 | public class ProviderApplication { 30 | /** 31 | * 启动方法 32 | * 33 | * @param args 参数 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(ProviderApplication.class); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/spring-cloud-registry-provider/src/main/java/com/huaweicloud/examples/registry/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * 启动类 24 | * 25 | * @author provenceee 26 | * @since 2022-08-29 27 | */ 28 | @SpringBootApplication 29 | public class ProviderApplication { 30 | /** 31 | * 启动方法 32 | * 33 | * @param args 参数 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(ProviderApplication.class); 37 | } 38 | } -------------------------------------------------------------------------------- /registry-demo/springboot-registry-demo/service-b/src/main/java/com/huawei/service/b/ServiceBApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.service.b; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * 启动类 24 | * 25 | * @author zhouss 26 | * @since 2022-10-13 27 | */ 28 | @SpringBootApplication(scanBasePackages = "com.huawei.service.b") 29 | public class ServiceBApplication { 30 | /** 31 | * 启动方法 32 | * 33 | * @param args 参数 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(ServiceBApplication.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.huaweicloud.sermant.examples 8 | sermant-examples 9 | 1.0.0 10 | pom 11 | 12 | first-plugin-demo 13 | registry-demo 14 | router-demo 15 | flowcontrol-demo 16 | grace-demo/spring-grace-nacos-demo 17 | tag-transmission-demo 18 | visibility-demo 19 | removal-demo 20 | monitor-demo 21 | mq-consume-prohibition-demo 22 | loadbalancer-demo 23 | database-write-prohibition-demo 24 | xds-demo 25 | mq-gray-demo 26 | 27 | 28 | 29 | 8 30 | 8 31 | 32 | 33 | -------------------------------------------------------------------------------- /loadbalancer-demo/resttemplate-consumer/src/main/java/com/huawei/zk/resttemplate/consumer/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.zk.resttemplate.consumer; 18 | 19 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 20 | import org.springframework.context.annotation.Bean; 21 | import org.springframework.web.client.RestTemplate; 22 | 23 | /** 24 | * restTemplate LoadBalance 25 | * 26 | * @author xuezechao1 27 | * @since 2022-02-07 28 | */ 29 | @org.springframework.context.annotation.Configuration 30 | public class Configuration { 31 | 32 | @Bean 33 | @LoadBalanced 34 | public RestTemplate restTemplate() { 35 | return new RestTemplate(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/service/impl/FlowControlVersionServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service.impl; 18 | 19 | import com.huaweicloud.integration.service.FlowControlVersionService; 20 | 21 | /** 22 | * 基于版本测试 23 | * 24 | * @author zhouss 25 | * @since 2022-09-15 26 | */ 27 | public class FlowControlVersionServiceImpl extends FlowControlServiceImpl implements FlowControlVersionService { 28 | @Override 29 | public String rateLimitingWithVersion() { 30 | return rateLimiting(); 31 | } 32 | 33 | @Override 34 | public String retry(String invocationId) { 35 | return ""; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/spring-provider/src/main/java/com/huaweicloud/examples/flow/provider/SpringProviderApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huaweicloud.examples.flow.provider; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | 23 | /** 24 | * 启动类 25 | * 26 | * @author zhouss 27 | * @since 2022-08-01 28 | */ 29 | @SpringBootApplication 30 | public class SpringProviderApplication { 31 | /** 32 | * 启动方法 33 | * 34 | * @param args 启动参数 35 | */ 36 | public static void main(String[] args) { 37 | SpringApplication.run(SpringProviderApplication.class, args); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-data/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-grace-nacos-demo 7 | org.springframework.boot 8 | 2.2.0.RELEASE 9 | 10 | 4.0.0 11 | 12 | nacos-rest-data 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | com.nacos.demo 22 | nacos-common 23 | 1.0.0 24 | compile 25 | 26 | 27 | 28 | ${artifactId} 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-maven-plugin 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /xds-demo/spring-cloud-server-xds/src/main/java/io/sermant/demo/xds/spring/server/SpringCloudServerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2024 Sermant Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.sermant.demo.xds.spring.server; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * SpringServerApplication 24 | * 25 | * @author daizhenyu 26 | * @since 2024-10-11 27 | **/ 28 | @SpringBootApplication 29 | public class SpringCloudServerApplication { 30 | /** 31 | * main 32 | * 33 | * @param args args 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(SpringCloudServerApplication.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-a/src/main/java/com/huawei/dubbotest/service/imp/ATestImp.java: -------------------------------------------------------------------------------- 1 | package com.huawei.dubbotest.service.imp; 2 | 3 | import com.huawei.dubbotest.domain.Test; 4 | import com.huawei.dubbotest.service.ATest; 5 | import com.huawei.dubbotest.service.BTest; 6 | 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | import javax.annotation.Resource; 13 | 14 | @Component 15 | public class ATestImp implements ATest { 16 | 17 | @Resource(name = "bTest") 18 | private BTest bTest; 19 | 20 | @Override 21 | public Map testEmpty(long id, String name) { 22 | return bTest.testEmpty(id, name); 23 | } 24 | 25 | @Override 26 | public Map testObject(Test test) { 27 | return bTest.testObject(test); 28 | } 29 | 30 | @Override 31 | public Map testEnabled(Test test) { 32 | return bTest.testEnabled(test); 33 | } 34 | 35 | @Override 36 | public Map testArray(String[] array) { 37 | return bTest.testArray(array); 38 | } 39 | 40 | @Override 41 | public Map testList(List list) { 42 | return bTest.testList(list); 43 | } 44 | 45 | @Override 46 | public Map testMap(Map map) { 47 | return bTest.testMap(map); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /database-write-prohibition-demo/mongodb-demo/src/main/java/com/huaweicloud/sermant/mongodb/MongoDbApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2024 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.sermant.mongodb; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * springboot startup class 24 | * 25 | * @author daizhenyu 26 | * @since 2024-03-05 27 | **/ 28 | @SpringBootApplication 29 | public class MongoDbApplication { 30 | /** 31 | * startup class 32 | * 33 | * @param args process startup input parameters 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(MongoDbApplication.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-zuul/src/main/java/com/huaweicloud/examples/router/ZuulApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.router; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 22 | 23 | /** 24 | * 启动类 25 | * 26 | * @author provenceee 27 | * @since 2022-07-26 28 | */ 29 | @EnableZuulProxy 30 | @SpringBootApplication 31 | public class ZuulApplication { 32 | /** 33 | * 启动方法 34 | * 35 | * @param args 参数 36 | */ 37 | public static void main(String[] args) { 38 | SpringApplication.run(ZuulApplication.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-consumer/src/main/java/com/huawei/nacos/rest/consumer/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huawei.nacos.rest.consumer; 19 | 20 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.web.client.RestTemplate; 23 | 24 | /** 25 | * 配置类 26 | * 27 | * @author zhouss 28 | * @since 2021-12-16 29 | */ 30 | @org.springframework.context.annotation.Configuration 31 | public class Configuration { 32 | /** 33 | * 请求配置 34 | * 35 | * @return RestTemplate 36 | */ 37 | @Bean 38 | @LoadBalanced 39 | public RestTemplate restTemplate() { 40 | return new RestTemplate(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /mq-gray-demo/rocketmq-gray-demo/rocketmq-gray-consumer-demo/src/main/java/io/sermant/demo/grayscale/rocketmq/consumer/RocketMqConsumerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2024 Sermant Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.sermant.demo.grayscale.rocketmq.consumer; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * springboot starter 24 | * 25 | * @author chengyouling 26 | * @since 2024-10-30 27 | **/ 28 | @SpringBootApplication 29 | public class RocketMqConsumerApplication { 30 | /** 31 | * main run 32 | * 33 | * @param args parameter 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(RocketMqConsumerApplication.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /mq-gray-demo/rocketmq-gray-demo/rocketmq-gray-producer-demo/src/main/java/io/sermant/demo/grayscale/rocketmq/producer/RocketMqProducerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2024 Sermant Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.sermant.demo.grayscale.rocketmq.producer; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | 22 | /** 23 | * springboot starer 24 | * 25 | * @author chengyouling 26 | * @since 2024-10-30 27 | **/ 28 | @SpringBootApplication 29 | public class RocketMqProducerApplication { 30 | /** 31 | * main run 32 | * 33 | * @param args parameter 34 | */ 35 | public static void main(String[] args) { 36 | SpringApplication.run(RocketMqProducerApplication.class, args); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-consumer/src/main/java/com/huaweicloud/examples/router/client/ProviderClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.router.client; 18 | 19 | import org.springframework.cloud.openfeign.FeignClient; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.RequestMethod; 22 | 23 | /** 24 | * feign client 25 | * 26 | * @author provenceee 27 | * @since 2022-07-26 28 | */ 29 | @FeignClient(name = "spring-cloud-router-provider") 30 | public interface ProviderClient { 31 | /** 32 | * 测试接口 33 | * 34 | * @return 测试信息 35 | */ 36 | @RequestMapping(value = "/hello", method = RequestMethod.GET) 37 | String hello(); 38 | } 39 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.3.4.RELEASE 9 | 10 | 11 | 4.0.0 12 | 13 | com.huaweicloud.sermant.examples 14 | dubbo-router-demo 15 | 1.0.0 16 | pom 17 | 18 | dubbo-a 19 | dubbo-b 20 | dubbo-demo-common 21 | spring-cloud-gateway 22 | 23 | 24 | 25 | 8 26 | 8 27 | 2.7.5 28 | 29 | 30 | 31 | 32 | org.apache.dubbo 33 | dubbo-spring-boot-starter 34 | ${dubbo.version} 35 | 36 | 37 | -------------------------------------------------------------------------------- /flowcontrol-demo/spring-cloud-demo/spring-consumer/src/main/java/com/huaweicloud/examples/flow/consumer/FeignRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huaweicloud.examples.flow.consumer; 19 | 20 | import org.springframework.cloud.openfeign.FeignClient; 21 | import org.springframework.web.bind.annotation.RequestMapping; 22 | import org.springframework.web.bind.annotation.RequestParam; 23 | 24 | /** 25 | * feign请求 26 | * 27 | * @author zhouss 28 | * @since 2022-09-02 29 | */ 30 | @FeignClient(name = "spring-flow-provider") 31 | public interface FeignRequest { 32 | /** 33 | * feign请求 34 | * 35 | * @param exRate 错误率 36 | * @return 结果 37 | */ 38 | @RequestMapping("/flow") 39 | String flow(@RequestParam(required = false, name = "exRate") Integer exRate); 40 | } 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yaml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Report a bug encountered while using sermant 3 | labels: kind/bug 4 | body: 5 | - type: textarea 6 | id: problem 7 | attributes: 8 | label: What happened? 9 | description: | 10 | Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. 11 | validations: 12 | required: true 13 | 14 | - type: textarea 15 | id: repro 16 | attributes: 17 | label: How can we reproduce it (as minimally and precisely as possible)? 18 | validations: 19 | required: true 20 | 21 | - type: textarea 22 | id: additional 23 | attributes: 24 | label: Anything else we need to know? 25 | 26 | - type: textarea 27 | id: sermantVersion 28 | attributes: 29 | label: Sermant version 30 | value: | 31 |
32 | 33 |
34 | validations: 35 | required: true 36 | 37 | - type: textarea 38 | id: osVersion 39 | attributes: 40 | label: OS version 41 | value: | 42 |
43 | 44 | ```console 45 | # On Linux: 46 | $ cat /etc/os-release 47 | # paste output here 48 | $ uname -a 49 | # paste output here 50 | 51 | # On Windows: 52 | C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture 53 | # paste output here 54 | ``` 55 |
56 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-consumer/src/main/java/com/huaweicloud/examples/registry/ConsumerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.context.annotation.ImportResource; 22 | 23 | /** 24 | * 启动类 25 | * 26 | * @author provenceee 27 | * @since 2022-08-29 28 | */ 29 | @SpringBootApplication 30 | @ImportResource({"classpath:dubbo/consumer.xml"}) 31 | public class ConsumerApplication { 32 | /** 33 | * spring启动类 34 | * 35 | * @param args 启动参数 36 | */ 37 | public static void main(String[] args) { 38 | SpringApplication.run(ConsumerApplication.class); 39 | } 40 | } -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-provider/src/main/java/com/huaweicloud/examples/registry/ProviderApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.context.annotation.ImportResource; 22 | 23 | /** 24 | * 启动类 25 | * 26 | * @author provenceee 27 | * @since 2022-08-29 28 | */ 29 | @SpringBootApplication 30 | @ImportResource({"classpath:dubbo/provider.xml"}) 31 | public class ProviderApplication { 32 | /** 33 | * spring启动类 34 | * 35 | * @param args 启动参数 36 | */ 37 | public static void main(String[] args) { 38 | SpringApplication.run(ProviderApplication.class); 39 | } 40 | } -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-b/src/main/java/com/huawei/dubbotest/service/DubboBApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2021 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.dubbotest.service; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.context.annotation.ImportResource; 22 | 23 | @SpringBootApplication 24 | @ImportResource({"classpath:dubbo/provider.xml", "classpath*:spring/dubbo-servicecomb.xml"}) 25 | public class DubboBApplication { 26 | public static void main(String[] args) { 27 | System.out.println("====================start======================="); 28 | SpringApplication.run(DubboBApplication.class); 29 | System.out.println("=====================end========================"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-provider/src/main/java/com/huaweicloud/integration/service/RemovalServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.service; 18 | 19 | import org.springframework.beans.factory.annotation.Value; 20 | 21 | /** 22 | * 获取端口信息 23 | * 24 | * @author zhp 25 | * @since 2023-03-16 26 | */ 27 | public class RemovalServiceImpl implements RemovalService { 28 | @Value("${timeout}") 29 | private long timeout; 30 | 31 | @Value("${server.port}") 32 | private Integer port; 33 | 34 | @Override 35 | public String getPort() { 36 | try { 37 | Thread.sleep(timeout); 38 | } catch (InterruptedException e) { 39 | throw new RuntimeException(e); 40 | } 41 | return String.valueOf(port); 42 | } 43 | } -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Auto Close Stale Issues and PRs 2 | 3 | on: 4 | schedule: 5 | # UTC/GMT+08:00 -> 北京时间凌晨4点执行 6 | - cron: "0 20 * * *" 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@v4.1.0 13 | name: Auto Close Stale Issues and PRs 14 | with: 15 | # 为不活跃的issue添加的标签 16 | stale-issue-label: Stale 17 | # issue的不活跃警告评论 18 | stale-issue-message: > 19 | This issue seems to be **Stale**. We will close it in a few days. 20 | # issue的关闭评论 21 | close-issue-message: > 22 | We close this issue because it hasn't been updated in a while. Remove **Stale** label if you want to reopen it. 23 | # issue不活跃判定时间,单位:天 24 | days-before-issue-stale: 29 25 | # issue最终关闭间隔时间,单位:天 26 | days-before-issue-close: 1 27 | 28 | # 为不活跃的pr添加的标签 29 | stale-pr-label: Stale 30 | # pr的不活跃警告评论 31 | stale-pr-message: > 32 | This PR seems to be **Stale**. We will close it in a few days. 33 | # pr的关闭评论 34 | close-pr-message: > 35 | We close this PR because it hasn't been updated in a while. Remove **Stale** label if you want to reopen it. 36 | # pr不活跃判定时间,单位:天 37 | days-before-pr-stale: 14 38 | # pr最终关闭间隔时间,单位:天 39 | days-before-pr-close: 1 40 | 41 | # 每次运行处理issue和PR条数,如果待处理的数量过多,可修改该值 42 | operations-per-run: 100 -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/spring-cloud-gateway/src/main/java/com/huawei/dubbotest/GatewayApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2021 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.dubbotest; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.context.annotation.ImportResource; 22 | 23 | @SpringBootApplication(scanBasePackages = {"com.huawei.dubbotest.service","com.huawei.dubbotest.controller"}) 24 | @ImportResource({"classpath:dubbo/consumer.xml"}) 25 | public class GatewayApplication { 26 | public static void main(String[] args) { 27 | System.out.println("====================start===================="); 28 | SpringApplication.run(GatewayApplication.class); 29 | System.out.println("====================end===================="); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-a/src/main/java/com/huawei/dubbotest/service/DubboAApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2021 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.dubbotest.service; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.context.annotation.ImportResource; 22 | 23 | @SpringBootApplication(scanBasePackages = {"com.huawei.dubbotest.service","com.huawei.dubbotest.controller"}) 24 | @ImportResource({"classpath:dubbo/provider.xml"}) 25 | public class DubboAApplication { 26 | public static void main(String[] args) { 27 | System.out.println("====================start======================="); 28 | SpringApplication.run(DubboAApplication.class); 29 | System.out.println("=====================end========================"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tag-transmission-demo/http-client-demo/src/main/java/com/huaweicloud/tag/demo/ClientController.java: -------------------------------------------------------------------------------- 1 | package com.huaweicloud.tag.demo; 2 | 3 | import org.apache.http.HttpEntity; 4 | import org.apache.http.client.methods.CloseableHttpResponse; 5 | import org.apache.http.client.methods.HttpGet; 6 | import org.apache.http.impl.client.CloseableHttpClient; 7 | import org.apache.http.impl.client.HttpClients; 8 | import org.apache.http.util.EntityUtils; 9 | import org.springframework.beans.factory.annotation.Value; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import java.io.IOException; 14 | 15 | /** 16 | * ClientController 17 | * 18 | * @author lilai 19 | * @since 2023-09-23 20 | */ 21 | @RestController 22 | public class ClientController { 23 | @Value("${http.server.ip}") 24 | private String ip; 25 | 26 | @Value("${http.server.port}") 27 | private int port; 28 | 29 | @GetMapping("/testHttpClient4") 30 | public String testHttpClient4() throws IOException { 31 | // 创建HttpClient实例 32 | CloseableHttpClient httpClient = HttpClients.createDefault(); 33 | 34 | // 创建HTTP GET请求 35 | HttpGet httpGet = new HttpGet("http://" + ip + ":" + port + "/hello"); 36 | 37 | // 执行请求并获取响应 38 | CloseableHttpResponse response = httpClient.execute(httpGet); 39 | 40 | // 获取响应实体 41 | HttpEntity entity = response.getEntity(); 42 | 43 | return EntityUtils.toString(entity); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/spring-cloud-router-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-cloud-router-demo 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | spring-cloud-router-provider 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | org.springframework.cloud 26 | spring-cloud-starter 27 | 28 | 29 | 30 | 31 | ${project.artifactId} 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-maven-plugin 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-a/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | dubbo-router-demo 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | dubbo-a 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | com.huaweicloud.sermant.examples 22 | dubbo-demo-common 23 | ${project.version} 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | 31 | 32 | ${project.artifactId} 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-maven-plugin 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-b/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | dubbo-router-demo 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | dubbo-b 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | com.huaweicloud.sermant.examples 22 | dubbo-demo-common 23 | ${project.version} 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | 31 | 32 | ${project.artifactId} 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-maven-plugin 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.3.4.RELEASE 9 | 10 | 11 | 4.0.0 12 | 13 | com.huaweicloud.sermant.examples 14 | spring-cloud-registry-demo 15 | 1.0.0 16 | pom 17 | 18 | spring-cloud-registry-provider 19 | spring-cloud-registry-consumer 20 | 21 | 22 | 23 | 8 24 | 8 25 | 26 | 27 | 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-dependencies 32 | Hoxton.RELEASE 33 | pom 34 | import 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/graceDown/data.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nacos-rest-data 5 | namespace: mesh 6 | labels: 7 | app: nacos-rest-data 8 | spec: 9 | type: NodePort 10 | ports: 11 | - port: 8008 12 | nodePort: 31011 13 | name: request 14 | - port: 5008 15 | nodePort: 31012 16 | name: debug 17 | selector: 18 | app: nacos-rest-data 19 | --- 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: nacos-rest-data 24 | namespace: mesh 25 | labels: 26 | app: nacos-rest-data 27 | spec: 28 | replicas: 1 29 | selector: 30 | matchLabels: 31 | app: nacos-rest-data 32 | template: 33 | metadata: 34 | labels: 35 | app: nacos-rest-data 36 | sermant-injection: enabled 37 | spec: 38 | containers: 39 | - name: nacos-rest-data 40 | image: data:1.0.2 41 | ports: 42 | - containerPort: 5008 43 | - containerPort: 8008 44 | env: 45 | # 注册中心地址 46 | - name: "dynamic.config.serverAddress" 47 | value: "127.0.0.1:30110" 48 | - name: "dynamic.config.dynamicConfigType" 49 | value: "KIE" 50 | # KIE配置中心地址 51 | - name: "servicecomb.service.address" 52 | value: "http://127.0.0.1:30100" 53 | - name: "servicecomb.service.enableSpringRegister" 54 | value: "true" 55 | - name: "servicecomb.service.openMigration" 56 | value: "false" 57 | imagePullSecrets: 58 | - name: default-secret 59 | -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/deploy/warmUp/data.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nacos-rest-data 5 | namespace: mesh 6 | labels: 7 | app: nacos-rest-data 8 | spec: 9 | type: NodePort 10 | ports: 11 | - port: 8008 12 | nodePort: 31011 13 | name: request 14 | - port: 5008 15 | nodePort: 31012 16 | name: debug 17 | selector: 18 | app: nacos-rest-data 19 | --- 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: nacos-rest-data 24 | namespace: mesh 25 | labels: 26 | app: nacos-rest-data 27 | spec: 28 | replicas: 1 29 | selector: 30 | matchLabels: 31 | app: nacos-rest-data 32 | template: 33 | metadata: 34 | labels: 35 | app: nacos-rest-data 36 | sermant-injection: enabled 37 | spec: 38 | containers: 39 | - name: nacos-rest-data 40 | image: data:1.0.2 41 | ports: 42 | - containerPort: 5008 43 | - containerPort: 8008 44 | env: 45 | # 注册中心地址 46 | - name: "dynamic.config.serverAddress" 47 | value: "127.0.0.1:30110" 48 | - name: "dynamic.config.dynamicConfigType" 49 | value: "KIE" 50 | # KIE配置中心地址 51 | - name: "servicecomb.service.address" 52 | value: "http://127.0.0.1:30100" 53 | - name: "servicecomb.service.enableSpringRegister" 54 | value: "true" 55 | - name: "servicecomb.service.openMigration" 56 | value: "false" 57 | imagePullSecrets: 58 | - name: default-secret 59 | -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-consumer/src/main/java/com/huaweicloud/examples/registry/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry.controller; 18 | 19 | import com.huaweicloud.examples.registry.api.HelloService; 20 | 21 | import org.springframework.web.bind.annotation.GetMapping; 22 | import org.springframework.web.bind.annotation.RestController; 23 | 24 | import javax.annotation.Resource; 25 | 26 | /** 27 | * 测试接口 28 | * 29 | * @author provenceee 30 | * @since 2022-08-29 31 | */ 32 | @RestController 33 | public class HelloController { 34 | @Resource(name = "helloService") 35 | private HelloService helloService; 36 | 37 | /** 38 | * 测试接口 39 | * 40 | * @return 测试信息 41 | */ 42 | @GetMapping("/hello") 43 | public String hello() { 44 | return helloService.hello(); 45 | } 46 | } -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/spring-cloud-registry-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | spring-cloud-registry-demo 7 | com.huaweicloud.sermant.examples 8 | 1.0.0 9 | 10 | 4.0.0 11 | 12 | spring-cloud-registry-provider 13 | 14 | 15 | 8 16 | 8 17 | 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | org.springframework.cloud 26 | spring-cloud-starter-zookeeper-discovery 27 | 28 | 29 | 30 | 31 | ${project.artifactId} 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-maven-plugin 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/entity/LaneTestEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.entity; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * 泳道测试实体 23 | * 24 | * @author provenceee 25 | * @since 2023-03-02 26 | */ 27 | public class LaneTestEntity implements Serializable { 28 | private static final long serialVersionUID = 1L; 29 | 30 | private final int id; 31 | 32 | private final boolean enabled; 33 | 34 | /** 35 | * 构造方法 36 | * 37 | * @param id id 38 | * @param enabled enabled 39 | */ 40 | public LaneTestEntity(int id, boolean enabled) { 41 | this.id = id; 42 | this.enabled = enabled; 43 | } 44 | 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | public boolean isEnabled() { 50 | return enabled; 51 | } 52 | } -------------------------------------------------------------------------------- /grace-demo/spring-grace-nacos-demo/nacos-rest-provider/src/main/java/com/huawei/nacos/rest/provider/stat/QpsUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.huawei.nacos.rest.provider.stat; 19 | 20 | /** 21 | * QPS工具类 22 | * 23 | * @author zhouss 24 | * @since 2022-06-20 25 | */ 26 | public class QpsUtils { 27 | private static final ThreadLocal LOCAL = new ThreadLocal<>(); 28 | 29 | private QpsUtils() { 30 | } 31 | 32 | /** 33 | * 保存QPS 34 | * 35 | * @param passQps qps 36 | */ 37 | public static void set(int passQps) { 38 | LOCAL.set(passQps); 39 | } 40 | 41 | /** 42 | * 获取qps 43 | * 44 | * @return qps 45 | */ 46 | public static Integer get() { 47 | return LOCAL.get(); 48 | } 49 | 50 | /** 51 | * 移除QPS 52 | */ 53 | public static void remove() { 54 | LOCAL.remove(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /router-demo/dubbo-router-demo/dubbo-demo-common/src/main/java/com/huawei/dubbotest/domain/Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2021 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huawei.dubbotest.domain; 18 | 19 | import java.io.Serializable; 20 | 21 | public class Test implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | private long id; 25 | 26 | private String name; 27 | 28 | private boolean enabled; 29 | 30 | public long getId() { 31 | return id; 32 | } 33 | 34 | public void setId(long id) { 35 | this.id = id; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | public boolean isEnabled() { 47 | return enabled; 48 | } 49 | 50 | public void setEnabled(boolean enabled) { 51 | this.enabled = enabled; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /router-demo/spring-cloud-router-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.3.4.RELEASE 9 | 10 | 11 | 4.0.0 12 | 13 | com.huaweicloud.sermant.examples 14 | spring-cloud-router-demo 15 | 1.0.0 16 | 17 | spring-cloud-router-consumer 18 | spring-cloud-router-provider 19 | spring-cloud-router-zuul 20 | 21 | pom 22 | 23 | 24 | 8 25 | 8 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.cloud 32 | spring-cloud-dependencies 33 | Hoxton.RELEASE 34 | pom 35 | import 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /xds-demo/spring-cloud-client-xds/src/main/java/io/sermant/demo/xds/spring/client/SpringCloudClientApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2024 Sermant Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.sermant.demo.xds.spring.client; 18 | 19 | import io.sermant.demo.xds.spring.client.config.MySqlConfig; 20 | 21 | import org.springframework.boot.SpringApplication; 22 | import org.springframework.boot.autoconfigure.SpringBootApplication; 23 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 24 | 25 | /** 26 | * SpringCloudClientApplication 27 | * 28 | * @author daizhenyu 29 | * @since 2024-09-23 30 | **/ 31 | @SpringBootApplication 32 | @EnableConfigurationProperties(MySqlConfig.class) 33 | public class SpringCloudClientApplication { 34 | /** 35 | * main 36 | * 37 | * @param args args 38 | */ 39 | public static void main(String[] args) { 40 | SpringApplication.run(SpringCloudClientApplication.class, args); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /monitor-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.7.17 9 | 10 | 11 | com.example 12 | monitor-demo 13 | 0.0.1-SNAPSHOT 14 | monitor-demo 15 | Demo project for Spring Boot 16 | 17 | 1.8 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | 33 | ${artifactId} 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-maven-plugin 38 | 39 | 40 | paketobuildpacks/builder-jammy-base:latest 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /registry-demo/spring-cloud-registry-demo/spring-cloud-registry-provider/src/main/java/com/huaweicloud/examples/registry/controller/ProviderController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry.controller; 18 | 19 | import org.springframework.beans.factory.annotation.Value; 20 | import org.springframework.web.bind.annotation.GetMapping; 21 | import org.springframework.web.bind.annotation.RestController; 22 | 23 | /** 24 | * ConsumerController 25 | * 26 | * @author provenceee 27 | * @since 2022-08-29 28 | */ 29 | @RestController 30 | public class ProviderController { 31 | @Value("${spring.application.name}") 32 | private String name; 33 | 34 | @Value("${server.port}") 35 | private int port; 36 | 37 | /** 38 | * 测试方法 39 | * 40 | * @return msg 41 | */ 42 | @GetMapping("hello") 43 | public String hello() { 44 | return "I'm " + name + ", my port is " + port + "."; 45 | } 46 | } -------------------------------------------------------------------------------- /database-write-prohibition-demo/mongodb-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.7.15 9 | 10 | 11 | 4.0.0 12 | 13 | mongodb-demo 14 | 15 | 16 | 8 17 | 8 18 | 4.7.0 19 | 20 | 21 | 22 | 23 | org.mongodb 24 | mongodb-driver-sync 25 | ${mongodb.version} 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-web 30 | 31 | 32 | 33 | 34 | ${project.artifactId} 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-maven-plugin 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-integration-api/src/main/java/com/huaweicloud/integration/client/ProviderClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.client; 18 | 19 | import org.springframework.cloud.openfeign.FeignClient; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.RequestMethod; 22 | 23 | import java.util.Map; 24 | 25 | /** 26 | * feign client 27 | * 28 | * @author provenceee 29 | * @since 2022-07-26 30 | */ 31 | @FeignClient(name = "dubbo-integration-provider") 32 | public interface ProviderClient { 33 | /** 34 | * 测试接口 35 | * 36 | * @return 测试信息 37 | */ 38 | @RequestMapping(value = "/hello", method = RequestMethod.GET) 39 | String hello(); 40 | 41 | /** 42 | * 测试接口 43 | * 44 | * @return 测试信息 45 | */ 46 | @RequestMapping(value = "/lane", method = RequestMethod.GET) 47 | Map getLane(); 48 | } 49 | -------------------------------------------------------------------------------- /xds-demo/spring-cloud-client-xds/src/main/java/io/sermant/demo/xds/spring/client/config/RestTemplateConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2024 Sermant Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.sermant.demo.xds.spring.client.config; 18 | 19 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 20 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.web.client.RestTemplate; 24 | 25 | /** 26 | * RestTemplateConfig 27 | * 28 | * @author daizhenyu 29 | * @since 2024-09-23 30 | **/ 31 | @Configuration 32 | public class RestTemplateConfig { 33 | /** 34 | * RestTemplate bean 35 | * 36 | * @return RestTemplate bean 37 | */ 38 | @Bean 39 | @ConditionalOnMissingBean 40 | @LoadBalanced 41 | public RestTemplate restTemplate() { 42 | return new RestTemplate(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /flowcontrol-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 22 | 23 | sermant-examples 24 | com.huaweicloud.sermant.examples 25 | 1.0.0 26 | 27 | 4.0.0 28 | 29 | flowcontrol-demo 30 | 用于流控治理测试 31 | 32 | spring-cloud-demo 33 | 34 | pom 35 | 36 | 37 | 8 38 | 8 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /visibility-demo/dubbo-2-6-integration-consumer/src/main/java/com/huaweicloud/integration/controller/RemovalController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.integration.controller; 18 | 19 | import com.huaweicloud.integration.service.RemovalService; 20 | 21 | import org.springframework.web.bind.annotation.GetMapping; 22 | import org.springframework.web.bind.annotation.RequestMapping; 23 | import org.springframework.web.bind.annotation.RestController; 24 | 25 | import javax.annotation.Resource; 26 | 27 | /** 28 | * 离群实例摘除测试接口 29 | * 30 | * @author zhp 31 | * @since 2023-03-16 32 | */ 33 | @RestController 34 | @RequestMapping("/removal") 35 | public class RemovalController { 36 | @Resource(name = "removalService") 37 | private RemovalService removalService; 38 | 39 | /** 40 | * 测试离群实例摘除接口接口 41 | * 42 | * @return 测试信息 43 | */ 44 | @GetMapping("/testReq") 45 | public String testReq() { 46 | return removalService.getPort(); 47 | } 48 | } -------------------------------------------------------------------------------- /registry-demo/dubbo-registry-demo/dubbo-registry-provider/src/main/java/com/huaweicloud/examples/registry/service/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.huaweicloud.examples.registry.service; 18 | 19 | import com.huaweicloud.examples.registry.api.HelloService; 20 | 21 | import org.apache.dubbo.config.RegistryConfig; 22 | import org.springframework.beans.factory.annotation.Autowired; 23 | import org.springframework.beans.factory.annotation.Value; 24 | 25 | /** 26 | * 测试接口 27 | * 28 | * @author provenceee 29 | * @since 2022-08-29 30 | */ 31 | public class HelloServiceImpl implements HelloService { 32 | @Autowired 33 | private RegistryConfig registryConfig; 34 | 35 | @Value("${dubbo.application.name}") 36 | private String name; 37 | 38 | @Value("${dubbo.protocol.port}") 39 | private String port; 40 | 41 | @Override 42 | public String hello() { 43 | return "I'm " + name + ", my registry center is " + registryConfig.getProtocol() + ", my port is " + port + "."; 44 | } 45 | } --------------------------------------------------------------------------------