Git Product home page Git Product logo

alibaba / spring-cloud-alibaba Goto Github PK

View Code? Open in Web Editor NEW
27.3K 977.0 8.1K 24.11 MB

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.

Home Page: https://sca.aliyun.com

License: Apache License 2.0

Java 98.31% Shell 0.30% JavaScript 0.11% HTML 1.13% Dockerfile 0.12% Smalltalk 0.03%
spring-cloud java spring microservices cloud-native spring-cloud-core alibaba-oss alibaba dubbo rocketmq

spring-cloud-alibaba's Introduction

Spring Cloud Alibaba

CircleCI Maven Central License actions Leaderboard

A project maintained by Alibaba.

See the 中文文档 for Chinese readme.

Spring Cloud Alibaba provides a one-stop solution for distributed application development. It contains all the components required to develop distributed applications, making it easy for you to develop your applications using Spring Cloud.

With Spring Cloud Alibaba, you only need to add some annotations and a small amount of configurations to connect Spring Cloud applications to the distributed solutions of Alibaba, and build a distributed application system with Alibaba middleware.

Features

  • Flow control and service degradation: Flow control for HTTP services is supported by default. You can also customize flow control and service degradation rules using annotations. The rules can be changed dynamically.
  • Service registration and discovery: Service can be registered and clients can discover the instances using Spring-managed beans. Load balancing is consistent with that supported by the corresponding Spring Cloud.
  • Distributed configuration: Support for externalized configuration in a distributed system, auto refresh when configuration changes.
  • Event-driven: Support for building highly scalable event-driven microservices connected with shared messaging systems.
  • Distributed Transaction: Support for distributed transaction solution with high performance and ease of use.
  • Alibaba Cloud Object Storage: Massive, secure, low-cost, and highly reliable cloud storage services. Support for storing and accessing any type of data in any application, anytime, anywhere.
  • Alibaba Cloud SchedulerX: Accurate, highly reliable, and highly available scheduled job scheduling services with response time within seconds.
  • Alibaba Cloud SMS: A messaging service that covers the globe, Alibaba SMS provides convenient, efficient, and intelligent communication capabilities that help businesses quickly contact their customers.

For more features, please refer to Roadmap.

In addition to the above-mentioned features, for the needs of enterprise users' scenarios, Microservices Engine (MSE) of Spring Cloud Alibaba's enterprise version provides an enterprise-level microservices governance center, which includes more powerful governance capabilities such as Grayscale Release, Service Warm-up, Lossless Online and Offline and Outlier Ejection. At the same time, it also provides a variety of products and solutions such as enterprise-level Nacos registration / configuration center, enterprise-level cloud native gateway.

Components

Sentinel: Sentinel takes "traffic flow" as the breakthrough point, and provides solutions in areas such as flow control, concurrency, circuit breaking, and load protection to protect service stability.

Nacos: An easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.

RocketMQ: A distributed messaging and streaming platform with low latency, high performance and reliability, trillion-level capacity and flexible scalability.

Seata: A distributed transaction solution with high performance and ease of use for microservices architecture.

Alibaba Cloud OSS: An encrypted and secure cloud storage service which stores, processes and accesses massive amounts of data from anywhere in the world.

Alibaba Cloud SMS: A messaging service that covers the globe, Alibaba SMS provides convenient, efficient, and intelligent communication capabilities that help businesses quickly contact their customers.

Alibaba Cloud SchedulerX: Accurate, highly reliable, and highly available scheduled job scheduling services with response time within seconds.

For more features please refer to Roadmap.

How to build

  • 2023.x branch: Corresponds to Spring Cloud 2023 & Spring Boot 3.2.x, JDK 17 or later versions are supported.
  • 2022.x branch: Corresponds to Spring Cloud 2022 & Spring Boot 3.0.x, JDK 17 or later versions are supported.
  • 2021.x branch: Corresponds to Spring Cloud 2021 & Spring Boot 2.6.x. JDK 1.8 or later versions are supported.
  • 2020.0 branch: Corresponds to Spring Cloud 2020 & Spring Boot 2.4.x. JDK 1.8 or later versions are supported.
  • 2.2.x branch: Corresponds to Spring Cloud Hoxton & Spring Boot 2.2.x. JDK 1.8 or later versions are supported.
  • greenwich branch: Corresponds to Spring Cloud Greenwich & Spring Boot 2.1.x. JDK 1.8 or later versions are supported.
  • finchley branch: Corresponds to Spring Cloud Finchley & Spring Boot 2.0.x. JDK 1.8 or later versions are supported.
  • 1.x branch: Corresponds to Spring Cloud Edgware & Spring Boot 1.x, JDK 1.7 or later versions are supported.

Spring Cloud uses Maven for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing:

./mvnw install

How to Use

Add maven dependency

These artifacts are available from Maven Central and Spring Release repository via BOM:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2023.0.0.1-RC2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

add the module in dependencies. If you want to choose an older version, you can refer to the Release Notes.

Examples

A spring-cloud-alibaba-examples module is included in our project for you to get started with Spring Cloud Alibaba quickly. It contains an example, and you can refer to the readme file in the example project for a quick walkthrough.

Examples:

Sentinel Example

Nacos Example

RocketMQ Example

Alibaba Cloud OSS Example

Version control guidelines

The version number of the project is in the form of x.x.x, where x is a number, starting from 0, and is not limited to the range 0~9. When the project is in the incubator phase, the version number is 0.x.x.

As the interfaces and annotations of Spring Boot 1 and Spring Boot 2 have been changed significantly in the Actuator module, and spring-cloud-commons is also changed quite a lot from 1.x.x to 2.0.0, we take the same version rule as SpringBoot version number.

  • 1.5.x for Spring Boot 1.5.x
  • 2.0.x for Spring Boot 2.0.x
  • 2.1.x for Spring Boot 2.1.x
  • 2.2.x for Spring Boot 2.2.x
  • 2020.x for Spring Boot 2.4.x
  • 2021.x for Spring Boot 2.6.x
  • 2022.x for Spring Boot 3.0.x
  • 2023.x for Spring Boot 3.2.x

Code of Conduct

This project is a sub-project of Spring Cloud, it adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

Use the Spring Framework code format conventions. If you use Eclipse you can import formatter settings using the eclipse-code-formatter.xml file from the Spring Cloud Build project. If using IntelliJ, you can use the Eclipse Code Formatter Plugin to import the same file.

Make sure all new .java files to have a simple Javadoc class comment with at least an @author tag identifying you, and preferably at least a paragraph on what the class is for.

Add the ASF license header comment to all new .java files (copy from existing files in the project)

Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes).

Add some Javadocs and, if you change the namespace, some XSD doc elements.

A few unit tests would help a lot as well —— someone has to do it.

If no-one else is using your branch, please rebase it against the current 2023.x (or other target branch in the main project).

When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit message (where XXXX is the issue number).

Contact Us

Mailing list is recommended for discussing almost anything related to spring-cloud-alibaba.

[email protected]: You can ask questions here if you encounter any problem when using or developing spring-cloud-alibaba.

spring-cloud-alibaba's People

Contributors

123liuziming avatar chuntaojun avatar danielliu1123 avatar dependabot[bot] avatar echooymxq avatar fangjian0423 avatar flystar32 avatar haojunren avatar kaori-seasons avatar li-xiao-shuang avatar lltx avatar ly641921791 avatar mercyblitz avatar mostcool avatar pbting avatar rivers-shall avatar ruansheng8 avatar slievrly avatar sorieee avatar spencergibb avatar steverao avatar theonefx avatar xiaolongzuo avatar xiejiashuai avatar xudaojie avatar yuhuangbin avatar yuluo-yx avatar zhaoyuguang avatar zhendong590 avatar zkzlx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-cloud-alibaba's Issues

org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'scopedTarget.app': Requested bean is currently in creation: Is there an unresolvable circular reference?

Hi dear,
When I use the zookeeper as the storage, I follow your comments as below:

  1. adding
    @SentinelDataSource("spring.cloud.sentinel.datasource")
    private DataSource dataSource;

@bean
public Converter myParser() {
return new JsonFlowRuleListParser();
}
in the startup class, JsonFlowRuleListParser class is based on your sample code, also.

  1. adding
    spring.cloud.sentinel.transport.dashboard = localhost:8989
    spring.cloud.sentinel.transport.port = 8721
    spring.cloud.sentinel.datasource.type = zk
    spring.cloud.sentinel.datasource.serverAddr = localhost:2181
    spring.cloud.sentinel.datasource.path = /Sentinel-Demo/SYSTEM-CODE-DEMO-FLOW
    spring.cloud.sentinel.datasource.converter = myParser
    in the application.properties file

In the document(https://github.com/spring-cloud-incubator/spring-cloud-alibaba/blob/master/spring-cloud-alibaba-examples/sentinel-example/sentinel-core-example/readme-zh.md).
The sample code is below:
spring.cloud.sentinel.datasource.configParser=myParser
But, it seems that there is no property of FileRefreshableDataSourceFactoryBean class and, I just use the spring.cloud.sentinel.datasource.converter instead of configParser

It is appreciated that you could try to review my issue, any feedback is helpful.

BR
Kimi

Can Sentinel support feign ?

RestTemplate 使用起来太不友好了,不如Feign方便。可否考虑支持下Feign。

Spring Framework RestTemplate is not convenient when used , can consider supproting Feign.

Get wrong instance list at first time

How to reproduce this issue, refer to followings:

I have registered 2 instances (ex service name are all 'a') to nacos server
Then I stop them
After a while, I do step 1 again
Then I get 2 instances from interface, for first time, it returns 1 instance or 0 instance. But I invoke again, it is fine to return 2 instances. Guess the cache issue?

rename spring-cloud-starter-sentinel spring-cloud-starter-alibaba-sentinel

The naming convention is 'spring-cloud-starter--'.
It looks like there is only one dependency, generally, if there would only be one dependency, there is no need for a starter. So another option would be to drop the starter and rename 'spring-cloud-alibaba-sentinel-autoconfigure' to 'spring-cloud-alibaba-sentinel'

1.X 不支持spring boot 1.3.8.Release 版本, FilterRegistrationBean找不到

java.lang.IllegalStateException: Could not evaluate condition on org.springframework.cloud.alibaba.sentinel.custom.SentinelAutoConfiguration#sentinelResourceAspect due to org/springframework/boot/web/servlet/FilterRegistrationBean not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @componentscan in the default package by mistake)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:55) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760) [spring-boot-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360) [spring-boot-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) [spring-boot-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at com.weimob.springbootdemo.ServiceApplication.main(ServiceApplication.java:33) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/web/servlet/FilterRegistrationBean
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_151]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_151]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_151]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:612) ~[spring-core-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524) ~[spring-core-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510) ~[spring-core-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:570) ~[spring-core-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:683) ~[spring-beans-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:627) ~[spring-beans-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597) ~[spring-beans-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445) ~[spring-beans-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975) ~[spring-beans-4.2.8.RELEASE.jar:4.2.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:320) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanType(BeanTypeRegistry.java:309) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:290) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:183) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:172) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:140) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:114) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-1.3.8.RELEASE.jar:1.3.8.RELEASE]
... 17 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.web.servlet.FilterRegistrationBean
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_151]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_151]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_151]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_151]
... 37 common frames omitted

Setting false on autoRegister of @EnableDiscoveryClient will throw exception and application failed to start

Description:

Field nacosRegistration in org.springframework.cloud.alibaba.nacos.NacosDiscoveryClient required a bean of type 'org.springframework.cloud.alibaba.nacos.registry.NacosRegistration' that could not be found.
- Bean method 'nacosRegistration' not loaded because @ConditionalOnProperty (spring.cloud.service-registry.auto-registration.enabled) found different value in property 'spring.cloud.service-registry.auto-registration.enabled'

Frequent heartbeat log prints

Please refer to log file, you can find a lot of hearbeat logs print in a very short time:

discovery 2018-09-17 20:13:41,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:13:41,924 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:13:51,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:13:51,925 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:14:01,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:14:01,925 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:14:01,994 INFO [com.taobao.vipserver.serverlist.updater] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] server list provided by user: [localhost:8080]
discovery 2018-09-17 20:14:11,924 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:14:11,925 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:14:21,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:14:21,925 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:14:31,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:14:31,924 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:14:31,995 INFO [com.taobao.vipserver.serverlist.updater] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] server list provided by user: [localhost:8080]
discovery 2018-09-17 20:14:41,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:14:41,924 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&
discovery 2018-09-17 20:14:51,923 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:107] - [BEAT] [] [] send beat to server:
discovery 2018-09-17 20:14:51,924 INFO [com.alibaba.nacos.naming.beat.sender] c.a.n.c.naming [Slf4jLogger.java:99] - [] [] [] Request from server: http://localhost:8080/nacos/v1/ns/api/clientBeat?beat=%7B%22cluster%22%3A%22DEFAULT%22%2C%22dom%22%3A%22discovery-springcloud-example-b%22%2C%22ip%22%3A%22192.168.0.107%22%2C%22port%22%3A5201%7D&encoding=UTF-8&dom=discovery-springcloud-example-b&

Metadata lost

That issue will be reproduced in a NEW Nacos Server. At the first time, micro service registers to Nacos Server, sometime some metadata will be lost

能否支持预初始化

  • 目前Sentinel-Starter不支持心跳连接等预初始化

  • 能否在Spring 容器启动时,进行相关预初始化,而不需要用户在第一次访问时在初始化

  • 因为这个初始化其实会耗费一定时间,比如要执行ServiceLoader进行加载,虽然时间短,但是仍然有时间损耗

  • 是否可提供相关配置项 默认为false 有用户控制行为

  • 目前已经提了一个PR,能否给看下是否可以?

Nacos server cache issue

After all service instances shut down, but it also can get them in nacos server cache via http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=seriviceId,that can be reproduced in nacos server 0.2.0 version, and nacos client 0.2.0 rc version.
How to reproduce:

  1. Start some services in IDE, mine is Eclipse
  2. And shutdown them by clicking stop button in Eclipse
  3. Wait for a while, visit http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=seriviceId by postman
  4. Found offline instances still display in postman

It seems not register local metadata to nacos discovery server

  1. define in properties, ex spring.cloud.nacos.discovery.metadata.group=example-service-group
  2. define in NacosDiscoveryProperties class, ex
    Map<String, String> metadata = nacosDiscoveryProperties.getMetadata();
    metadata.put("group", "example-service-group");

Rules from Ctrip Apollo could not be updated automatically

Hi dear,

The Apollo of Ctrip has been used as the storage and, there have been three rules that I config in Apollo as below:
"FlowRules": [
{
"controlBehavior": 0,
"count": 1.0,
"grade": 1,
"limitApp": "default",
"maxQueueingTimeMs": 500,
"refResource": null,
"resource": "/p1",
"strategy": 0,
"warmUpPeriodSec": 10
},
{
"controlBehavior": 0,
"count": 1.0,
"grade": 1,
"limitApp": "default",
"maxQueueingTimeMs": 500,
"refResource": null,
"resource": "/p",
"strategy": 0,
"warmUpPeriodSec": 10
},
{
"controlBehavior": 0,
"count": 1.0,
"grade": 1,
"limitApp": "default",
"maxQueueingTimeMs": 500,
"refResource": null,
"resource": "testresource",
"strategy": 0,
"warmUpPeriodSec": 10
}
]

And, in my local macbook, to visit http://localhost:myport/actuator/sentinel that I could see these three rules.
But, I tried to modify the rules in Apollo, which two rules were removed and, it seems that Sentinel console still fetch these three original rules or, is there any additional command that I need to run or not?
I am not sure that is it an issue or Sentinel does not support fetch latest rules from external data source, such as zookeeper or apollo.
What I read is from https://github.com/alibaba/Sentinel/wiki/FAQ - 规则存储与动态规则数据源(DataSource)

It seems that it does not affect external json file as data storage, also. I added a new rule in Sentinel console but, no change of the json file at all.

Any feedback is appreciated.
BR
Kimi

如何构建问题

Uploading image.png…
我只想构建一个config-server可以吗,构建所有项目要下很久。

Rules from local file could not be added automatically

rules content:

[ { "resource": "hello", "controlBehavior": 0, "count": 0, "grade": 0, "limitApp": "default", "strategy": 0 }, { "resource": "test", "controlBehavior": 0, "count": 0, "grade": 0, "limitApp": "default", "strategy": 0 } ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.