spring-cloud 相关问题

Spring Cloud提供了在分布式系统中快速构建通用模式的工具(例如配置管理,服务发现,断路器,智能路由,微代理,控制总线,全局锁定,领导选举,分布式会话)。这些系统的协调导致锅炉板模式,使用Spring Cloud,您可以快速创建实现这些模式的应用程序。

Spring 云配置安全

我做了一个经典的授权是spring cloud config server这样的: http.csrf().disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.ALWAYS) .and()...

回答 1 投票 0

我们已经有了侦探,为什么还要使用 Jaeger?

Jaeger 好像是一个新的实现分布式追踪的库。 但是从 Jaeger 的角度来看,它似乎提供了与 Sleuth 相同的功能。 Sleuth 现在也支持 opentracing。 那我们为什么

回答 0 投票 0

是否可以使用 eureka 服务名称配置 spring config 客户端 uri?

我的项目有以下组件: Eureka 服务器(此处为存储库) 配置服务器(此处为存储库) 产品服务(此处为存储库) 带有配置文件的 Github 存储库(这里是 repo...

回答 1 投票 0

多模块 gradle 项目。导入问题

我有微服务架构的项目。 我正在尝试将我的一个模块(#1)导入到我项目的另一个模块(#2)中,以在模块#2 中使用模块#1 的类。 我试图在 m 中添加依赖项...

回答 2 投票 0

如何使用 Spring Cloud Gateway 将 Headers 转发到微服务?

使用 Spring Cloud Gateway 如何使用 application.yml 中的适当配置将标头转发到微服务?

回答 0 投票 0

OpenFeign 请求抛出 AbstractMethodError

要求: @Headers("userId: {userId}") @RequestMapping(method = RequestMethod.GET, value = "/token") String getToken(@RequestHeader(name = "userId") 长我们...

回答 2 投票 0

有Spring-boot和Spring-cloud的兼容性矩阵吗?

我想知道Springboot和Springcloud之间是否存在兼容性矩阵? 我在 STS 上创建了一个简单的项目,但遇到了兼容性问题。 我想知道Springboot和Springcloud之间是否存在兼容性矩阵? 我在 STS 上创建了一个简单的项目,但遇到了兼容性问题。 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Camden.SR5</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 了解 Springboot 和 Springcloud 的受支持版本将使事情变得更简单。 我确实观察到一个讨论这种需求的开放问题 - https://github.com/spring-cloud/spring-cloud-build/issues/43 社区在开始 SpringCloud 项目时是否有关于如何选择开始特定版本组合的方法? 编辑:添加我昨天以来遇到的此类问题的另一个实例 pom.xml 中的片段 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.2.RELEASE</version> <!--<version>1.5.2.RELEASE</version> --> <relativePath /> <!-- lookup parent from repository --> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <!-- <version>Camden.SR6</version --> <!-- <version>Brixton.SR5</version> --> <!-- <version>Camden.SR6</version> --> <version>Camden.SR5</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 将 1.5.2.RELEASE 与 Camden.SR5 一起使用没有 Maven 错误,但是当应用程序启动时它会抛出 NoClassDefFoundError。 2017-03-28 09:51:15.148 ERROR 15808 --- [ main] o.s.boot.SpringApplication : Application startup failed java.lang.NoClassDefFoundError: org/springframework/cloud/context/named/NamedContextFactory$Specification at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_112] at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_112] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_112] at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_112] at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_112] at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_112] at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_112] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_112] at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_112] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112] at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerClientConfiguration(FeignClientsRegistrar.java:367) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerDefaultConfiguration(FeignClientsRegistrar.java:104) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.cloud.netflix.feign.FeignClientsRegistrar.registerBeanDefinitions(FeignClientsRegistrar.java:87) ~[spring-cloud-netflix-core-1.2.5.RELEASE.jar:1.2.5.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:352) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:143) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:320) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:270) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] at com.forecastessentials.school.SchoolUniformForecastApplication.main(SchoolUniformForecastApplication.java:12) [classes/:na] Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.context.named.NamedContextFactory$Specification at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112] ... 31 common frames omitted 将 1.4.5 与 Brixton.SR6 结合使用通常对我来说效果很好。 2023年1月更新 Spring Cloud 发布火车 Spring Boot 兼容性 兼容性矩阵 春云 春季启动 2022.0.x 又名 Kilburn 3.0.x 2021.0.3+ 又名禧年 2.6.x, 2.7.x 2021.0.x 又名银禧 2.6.x 2020.0.3+ 又名伊尔福德 2.4.x, 2.5.x 2020.0.x 又名伊尔福德 2.4.x ⚠ Spring Cloud以下版本已全部停产,不再支持 春云 春季启动 霍克斯顿.SR5+ 2.2.x, 2.3.x 霍克斯顿 2.2.x 格林威治 2.1.x 芬奇利 2.0.x 埃奇韦尔 1.5.x 达尔斯顿 1.5.x 卡姆登.SR5+ 1.4.x, 1.5.x 卡姆登 1.4.x 布里克斯顿 1.3.x, 1.4.x 天使 1.2.x ⚠ 以下是 Spring Cloud(预览版)的里程碑。 春云 春季启动 2022.0.0-M4 3.0.0-M4 2022.0.0-M3 3.0.0-M3 2022.0.0-M2 3.0.0-M2 2022.0.0-M1 3.0.0-M1 2021.0.0-M2 2.6.0-M3 来源: Spring Cloud项目页面 Spring Cloud 2021.0.0-M2(代号Jubilee)可用 Spring Cloud 2021.0.0(代号Jubilee)已发布 Spring Cloud 路线图和 EOL 公告 2022.0.0-M1PRE参考文档 Spring Cloud 2022.0.0-M2(代号Kilburn)已发布 Spring Cloud 2022.0.0-M3(代号Kilburn)已发布 这里是 release train Spring Boot 兼容性表。在表格下方,有一条注释表明 Camden 发布序列基于 Spring Boot 1.4.x 构建,但也使用 1.5.x 进行了测试 您还可以阅读每个版本的发行说明,其中记录了兼容的组件版本: Spring Cloud Camden 基于 Spring Boot 1.4.x. 但后来: 添加 Boot 1.5 兼容性并破坏 Boot 1.3 兼容性 是的,有:http://start.spring.io/actuator/info 它包含的库不仅仅是 spring-cloud,但不是每个库都包含。 2023,找到最新的匹配版本的Spring Boot和Spring Cloud仍然很乏味......这里有一个过程: 在 https://spring.io/projects/spring-cloud Release Trains 表中查找兼容性矩阵,它显示了 Spring Boot 和 Spring Cloud Release Train 版本匹配。截至 2022-12-06 发布列车: 点击“Release Train”栏中的链接(屏幕截图:在左侧)以访问 Spring Cloud 发行说明,其中提到了最新的“Release Train”版本。 例如:“Hoxton ==> Hoxton.SR12”。 或者:在https://github.com/spring-cloud/spring-cloud-release/tags中找到最新匹配的Spring Cloud Release Train版本。 从“引导版本”列中选择值并在 Spring Boot 版本中查找最高匹配版本,此处:https://github.com/spring-projects/spring-boot/releases 或(更快)这里:https://github.com/spring-projects/spring-boot/tags.示例继续:“==> v2.3.12.RELEASE”. 另一个信息来源是 Spring 博客类别“发布”:https://spring.io/blog/category/releases,但恕我直言,这有点......令人困惑。 我找到了一种方法来获得 spring boot 和 spring cloud 之间的确切版本兼容性。 "� 7621 �只需访问此 URL:https://start.spring.io/actuator/info\n"spring-cloud": { "Hoxton.SR12": "Spring Boot >=2.2.0.RELEASE and <2.4.0.M1", "2020.0.5": "Spring Boot >=2.4.0.M1 and <2.6.0-M1", "2021.0.0-M1": "Spring Boot >=2.6.0-M1 and <2.6.0-M3", "2021.0.0-M3": "Spring Boot >=2.6.0-M3 and <2.6.0-RC1", "2021.0.0-RC1": "Spring Boot >=2.6.0-RC1 and <2.6.1", "2021.0.1": "Spring Boot >=2.6.1 and <2.6.5-SNAPSHOT", "2021.0.2-SNAPSHOT": "Spring Boot >=2.6.5-SNAPSHOT and <3.0.0-M1", "2022.0.0-M1": "Spring Boot >=3.0.0-M1 and <3.1.0-M1" },

回答 5 投票 0

How to connect spring cloud config server to Bitbucket using SSH keys?

我正在尝试创建一个 spring 云配置服务器以使用 SSH URI 连接到 git 存储库(bitbucket)。我正在关注 Spring Cloud Config。 我使用命令生成了密钥对 ssh-keygen -m...

回答 0 投票 0

Spring Cloud Config Vault 不适用于默认配置文件

我正在按照 Manning 的书 Spring microservices in action 2e 来实现配置服务器,我遇到了一个问题,即配置服务器不从默认值中读取属性

回答 1 投票 0

AWS Lambda 使用 Spring Cloud 执行(冷启动)需要很长时间

我们试图将现有的 Spring boot rest API 转换为 AWS 无服务器架构。 下面是我们正在遵循的架构。 API 网关 --> AWS Lambda -->

回答 1 投票 0

在 yml 上配置时 GCP 凭证为空

我正在尝试使用spring cloud访问云存储上的gcp bucket ... 问题是当我使用环境 GOOGLE_APPLICATION_CREDENTIALS=/User/Downloads/key.json 运行我的应用程序时 存储对象加载...

回答 0 投票 0

带有服务主体的 spring boot 的事件中心连接问题

当我在 Spring Boot 中使用服务主体将事件发送到事件中心应用程序的反应方式时,出现错误 “amqp:unauthorized-access”错误描述“未经授权

回答 1 投票 0

GCP Cloud Run 请求日志中的 Spring Trace Id 和 Span ID

我在我的 GCP 云运行应用程序中使用 spring cloud GCP 日志记录和跟踪 我在我的 GCP 云运行应用程序中使用 spring cloud GCP 日志记录和跟踪 <configuration> <include resource="org/springframework/boot/logging/logback/defaults.xml"/> <include resource="org/springframework/boot/logging/logback/console-appender.xml"/> <include resource="org/springframework/cloud/gcp/logging/logback-appender.xml"/> <root level="INFO"> <appender-ref ref="STACKDRIVER"/> </root> </configuration> 添加后我可以看到日志被分组了 现在我有两个问题 我们可以在请求日志中打印跟踪 ID 和跨度 ID 吗? 添加stack driver后,spring default console pattern不显示。所有日志都以原始格式打印。他们没有线程名称、span id、appName 等 这两个能实现吗?

回答 0 投票 0

Spring启动Eureka服务器项目无法启动

我刚刚创建了Spring Boot项目(使用Gradle Buildship 3.x),并且我在主类上启用了Eurekaserver.I am getting following error Caused by: org.springframework.beans.factory...。

回答 1 投票 0

更改netflix功能区的端口号

我有两个服务。一个运行在8001端口上,并且在eureka服务器中注册,另一个运行在8002端口上,并且在eureka中不存在。我想在我的本地ribbon客户端中将端口8001改为8002。I ...

回答 1 投票 0

Spring Cloud Sleuth 如何在 Webflux ouf of the box 中传播 MDC 上下文,以便在不同的线程中记录其内容?

我想知道Spring Cloud Sleuth是如何在线程之间传播MDC上下文,使每个线程的MDC参数都可用。我读过这篇文章https:/simonbasle.github.io201802...。

回答 1 投票 0

使用kafka启动服务时出现java.lang.NoSuchMethodError。

我正在尝试做一个小的微服务项目来接触kafka,我使用docker compose: kafka-server: image来启动kafka。为了启动kafka,我使用docker compose: kafka-server: image: spotifykafka ports: - 2181:2181 - 9092:9092 环境: ...

回答 1 投票 0

Spring Cloud配置为文件中的数组抛出NPE空。

我们用的是Spring Cloud Config 2.1版本,可以用。我们更新到Spring Cloud Config 2.2,现在不能用了。更多详情请点击https:/github.comspring-cloudspring-cloud-configissues1599 ...

回答 1 投票 0

在Spring云配置服务器上添加多个仓库

我需要在配置服务器上添加两个配置仓库。但是,它只选取了一个配置库。谁能帮我解决这个问题。配置服务器 bootstrap.yml server: port: 8899 ...

回答 1 投票 1

spring cloud stream支持json header?

我们所有的消费类应用都使用spring-cloud-stream,但我们的一个大型生产类应用(legacy...)因为spring boot版本是1.4,所以不能使用spring-cloud-stream。但是我们的一个大型生产者应用(legacy...)不能使用spring-cloud-stream,因为spring boot版本是1.4。我们尝试用...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.