Code Monkey home page Code Monkey logo

spring-cloud-huawei's Introduction

License Maven Central

Spring Cloud Huawei 查看中文文档

Spring Cloud Huawei is a framework that makes it easier and productive to develop microservices with Spring Cloud.

Spring Cloud Huawei supports Apache ServiceComb and Nacos as discovery, registration and configuration management service.

Spring Cloud Huawei provides a large number of out-of-the-box service governance capabilities, enabling developers to quickly build resilient and reliable microservice applications.

Service CSE(ServiceComb) CSE(Nacos)
Discovery and Registration servicecomb-service-center nacos
Configuration Management servicecomb-kie nacos

CSE provides commercial versions of ServiceComb and Nacos.

Supported version

Branch Spring Cloud Huawei Latest Version Compiled Spring Cloud Version Compiled Spring Boot Version Tested JDK Version Notes
master 1.11.7-2023.0.x 2023.0.11 3.2.4 OpenJDK 17
2022.0.x 1.11.7-2022.0.x 2022.0.5 3.1.9 OpenJDK 17
2021.0.x 1.11.7-2021.0.x 2021.0.9 2.7.18 OpenJDK 8
2020.0.x 1.10.8-2020.0.x 2020.0.6 2.5.14 OpenJDK 8 End of Support
Hoxton 1.9.4-Hoxton Hoxton.SR9 2.3.5.RELEASE OpenJDK 8 End of Support
Greenwich 1.6.4-Greenwich Greenwich.SR6 2.1.6-RELEASE OpenJDK 8 End of Support
Finchley 1.6.1-Finchley 2.0.4.RELEASE 2.0.9.RELEASE OpenJDK 8 End of Support
Edgware 1.2.0-Edgware 1.3.6.RELEASE 1.5.22.RELEASE OpenJDK 8 End of Support

Notice:

  • You can use Spring Cloud compatible version to use Spring Cloud Huawei. See https://spring.io/projects/spring-cloud for more details.
  • Spring Cloud Edgeware, Finchley, Greenwich, Hoxton, 2020.0.x have all reached end of life status and suggest not for production use. Check Spring Cloud Releases for details.
  • Before Hoxton(include), Netfix OSS like Ribbon, Hystrix are supported. After 2020.0.x(include), Spring Cloud Loadbalancer are supported.
  • Before 2020.0.x(include), springfox is used for swagger generation. After 2021.0.x(include), springdoc is used for swagger generation.
  • After 2022.0.x(include), JDK 17+ is needed to run.
  • Spring Cloud Huawei historical versions Spring Boot, Spring Cloud dependency description reference version description.

How to use

  1. Quick Start and Developer Guide
  2. Samples
  3. CSE Guide
  4. ServiceStage Guide

spring-cloud-huawei's People

Contributors

andotorg avatar angli2 avatar chengyouling avatar ctlove0523 avatar dantesun avatar david6969xin avatar dependabot[bot] avatar develpoerx avatar freesky-edward avatar gloriawish avatar glovethu avatar guoyl123 avatar heyile avatar hujinming178 avatar kaister3 avatar lbc97 avatar liubao68 avatar m13922236379 avatar provenceee avatar qiangtoudianyan avatar shoothzj avatar tianxiaoliang avatar vientu avatar wangqj avatar yoc19970520 avatar zhaozw 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

spring-cloud-huawei's Issues

依赖管理错误

<dependency>
<groupId>com.huaweicloud</groupId>
<artifactId>spring-cloud-huawei-dependencies</artifactId>
<version>1.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
在当前这个版本中,指定了
<spring-cloud.version>2.1.2.RELEASE</spring-cloud.version>
<spring-boot.version>2.1.6.RELEASE</spring-boot.version>
为什么还要指定<spring.version>5.2.3.RELEASE</spring.version>,spring的版本本身对springmvc就是有版本依赖管理的现在这样指定版本是有冲突的spring-boot的版本过低导致spring的api不兼容,我们发布前不测吗?基本的应用启动都起不来。

refactor all code package to com.huaweicloud

Currently is

org.springframework.cloud.huawei.config

and

org.springframework.cloud.dtm.consumer.feign

These are not very good. Change to the following

com.huaweicloud.config

and

com.huaweicloud.dtm

there are missing depndency

there are missing depndencies like:

<dependency>
  <groupId>com.huawei.paas.dtm</groupId>
  <artifactId>dtm-client</artifactId>
</dependency>

spring cloud gateway error log

gateway will invoke com.huaweicloud.servicecomb.discovery.discovery.ServiceCombDiscoveryClient#getServices
get all service include which status are not UP.
that will cause a error log when invoke getInstances() following:
2020-01-06 10:24:35.968 ERROR 10112 --- [ main] c.h.c.ServiceCombPropertySourceLocator : read response failed. status=401;mesage=Unauthorized

serviceComb集成springcloudgateway无法使用微服务id进行路由导航

同样使用例子中的spring-cloud-starter-huawei-servicecomb-discovery进行服务注册

测试可以使用服务id进行路由导航

gateway使用spring-cloud-starter-huawei-servicecomb-discovery,

服务提供者

org.apache.servicecomb
spring-boot-starter-provider
1.1.0

进行注册, 可以使用uri的方式进行路由,但是使用微服务id的方式进行路由报如下错误
java.lang.IllegalStateException: Invalid host: lb://workspace_service
at org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter.filter(RouteToRequestUrlFilter.java:86) ~[spring-cloud-gateway-core-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.cloud.gateway.handler.FilteringWebHandler$GatewayFilterAdapter.filter(FilteringWebHandler.java:138) ~[spring-cloud-gateway-core-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.cloud.gateway.filter.OrderedGatewayFilter.filter(OrderedGatewayFilter.java:44) ~[spring-cloud-gateway-core-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at org.springframework.cloud.gateway.handler.FilteringWebHandler$DefaultGatewayFilterChain.lambda$filter$0(FilteringWebHandler.java:118) ~[spring-cloud-gateway-core-2.1.2.RELEASE.jar:2.1.2.RELEASE]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44) [reactor-core-3.2.10.RELEASE.jar:3.2.10.RELEASE]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) [reactor-core-3.2.10.RELEASE.jar:3.2.10.RELEASE]

modify package name

some package name in the unit test is
org.springcloudframework.cloud
we need to change it to
com.huaweicloud

<bug>A problem when discovery

if exist mutiple instances with different version , we can only get the latest version instance .
cause:
org.springframework.cloud.servicecomb.discovery.client.model.ServiceRegistryConfig#DEFAULT_CALL_VERSION
it's a fix value

Compilation fails

version: master
env: macos10.13 + jdk 1.8


dtm-client:jar:1.0.2  not found  why config  travis and  can not work
[ERROR] Failed to execute goal on project spring-cloud-huawei-dtm: Could not resolve dependencies for project com.huaweicloud:spring-cloud-huawei-dtm:jar:1.2.0: Failure to find com.huawei.paas.dtm:dtm-client:jar:1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :spring-cloud-huawei-dtm

更新Components

sch看上去已经有很多组件了,但是readme没有同步更新

About the irregular config keys

Hi. The configurations for feature switch are irregular in spring-cloud-huawei.
For example, the config item to enable the credentials is spring.cloud.servicecomb.credentials.enable, while the config item to enable the service registry is spring.cloud.servicecomb.discovery.enabled. Conventionally, such kind of config items are usually suffixed by enabled.
And I find that the config key spring.cloud.servicecomb.discovery.enabled are referred in different places in literal form. Maybe it's better to define a const for it.
Any ideas? : )

huawei-config中properties的配置参数不统一还是就是如此设计

在properties中使用的是enable而在@ConditionalOnProperty中使用的是enabled,名称为什么不统一

@Component @ConfigurationProperties("spring.cloud.servicecomb.config") public class ServiceCombConfigProperties { private boolean enable = true;

@Configuration @ConditionalOnServiceCombEnabled @ConditionalOnProperty( name = {"spring.cloud.servicecomb.config.enabled"}, matchIfMissing = true ) public class ServiceCombConfigAutoConfiguration

@Configuration @ConditionalOnProperty( name = {"spring.cloud.servicecomb.config.enabled"}, matchIfMissing = true ) public class ServiceCombConfigBootstrapConfiguration

支持open api文档自动生成

可以要求开发者写注解,service center支持契约的管理,期望服务启动后能够自动注册契约到service center中

swagger generator produces should not include text/plain

@RestController
@RequestMapping(path = "/", produces = MediaType.APPLICATION_JSON_VALUE)
public class UserEndpoint {
  @Autowired
  private UserService userService;

  @PostMapping(path = "/v1/user/login", produces = MediaType.APPLICATION_JSON_VALUE)
  @ResponseBody
  public SessionInfo login(@RequestParam(name = "userName") String userName,
      @RequestParam(name = "password") String password) {
    return userService.login(userName, password);
  }

got

paths:
  /v1/user/login:
    post:
      tags:
      - "UserEndpoint"
      summary: "login"
      operationId: "login"
      schemes: []
      consumes:
      - "text/plain"
      - "application/json"
      produces:
      - "text/plain"
      - "application/json"
      parameters:
      - name: "password"
        in: "query"
        description: "password"
        required: true
        type: "string"
      - name: "userName"
        in: "query"
        description: "userName"
        required: true
        type: "string"
      responses:
        200:
          description: "OK"
          examples: {}
          headers: {}
          schema:
            $ref: "#/definitions/SessionInfo"
        201:
          description: "Created"
          examples: {}
          headers: {}
        401:
          description: "Unauthorized"
          examples: {}
          headers: {}
        403:
          description: "Forbidden"
          examples: {}
          headers: {}
        404:
          description: "Not Found"
          examples: {}
          headers: {}
      security: []
      deprecated: false

This is not correct

Support webflux

[dtm module] and [router modele] only support feign client and resttemplet client for now.
We need support spring webflux in the future.

fix config bug for long path

Servicestage constraints docker file path to have xx words, and lastest version fixed this issue. The docker file and scripts with short path can be deleted.

add application name

ServiceComb has application name , spring cloud not have this.
It is for aggregation services

微服务移步注册方式

com/huaweicloud/servicecomb/discovery/registry/ServiceCombServiceRegistry.java
这个java类中涉及到服务注册的环境,里头的loopRegister反复注册的方法采用了while(true)的方式,微服务启动过程如果没有配置注册中心地址或者没有启动注册中心的话,会一直在这里做循环,主函数main中的SpringApplication.run后面的执行语句如打印服务启动成功日志会因此无法执行。
是否可以考虑优化成异步注册的方式,异步处理重试注册的场景?

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.