spring-cloud-config 相关问题

Spring Cloud Config为分布式系统中的外部化配置提供服务器和客户端支持。

是否已弃用 application.properties 用于配置微服务网关?

我最近完成了 3 个月前的教程,但建议的 API 网关配置并未按预期工作。我在尝试访问 /quiz-services 时遇到 404 错误。可以

回答 1 投票 0

如何在工作流程中保护我的 GitHub 令牌并使用 Docker 进行 Spring Cloud 配置进行部署?

使用 github 工作流程在 docker 上部署 Spring Cloud 配置服务器密码时如何保护 github 令牌并在开发时保持存储库公开 构建配置服务器: ...

回答 1 投票 0

Spring Cloud 配置服务器 - 用于刷新密钥的空数组

我有一个 Spring Cloud 配置服务器,如本存储库中所示 以及这个仓库中的一个客户端 以下是我的POM文件 我有一个 Spring Cloud 配置服务器,如这个 repo 还有这个 repo 中的客户 以下是我的POM文件 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.8.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.ali.wassouf.spring.cloud.client</groupId> <artifactId>cloud-config-app</artifactId> <version>0.0.1-SNAPSHOT</version> <name>cloud-config-app</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-stream-rabbit</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-monitor</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> 配置服务器的application.yml server: port: 8081 spring: application: name: cloud-config-server cloud: config: server: monitor: github: enabled: true gitee: enabled: true git: password: ${PASSWORD} username: ${USERNAME} uri: https://github.com/Ali-Wassouf/springcloudconfigrepo search-paths: '{application}' 该服务器提供的配置存储库具有以下结构 . +-- serviceA | +-- application-dev.properties | +-- application-prod.properties +-- serviceB | +-- application-dev.properties | +-- application-prod.properties 我为配置存储库配置了一个 Webhook。 我还有一个本地运行的rabbitMQ镜像。 当我将更改推送到配置存储库时,我会在控制台上看到这些行 o.s.c.c.monitor.PropertyPathEndpoint : Refresh for: *:prod s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f: startup date [Mon Nov 23 18:55:19 CET 2020]; root of context hierarchy o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on [class org.springframework.cloud.config.client.ConfigServiceBootstrapConfiguration$RetryConfiguration]: java.lang.IllegalStateException: Could not obtain annotation attribute value for public abstract java.lang.Class[] org.springframework.boot.autoconfigure.condition.ConditionalOnClass.value() trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$aacb9e64] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7d2d9a8f: startup date [Mon Nov 23 18:55:20 CET 2020]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f o.s.boot.SpringApplication : Started application in 1.515 seconds (JVM running for 31.102) s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@7d2d9a8f: startup date [Mon Nov 23 18:55:20 CET 2020]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f: startup date [Mon Nov 23 18:55:19 CET 2020]; root of context hierarchy o.s.cloud.bus.event.RefreshListener : Received remote refresh request. Keys refreshed [] 刷新的键数组为空 我尝试更改为较旧版本的 Spring Boot/Cloud 以及较新版本,但这不起作用。 我见过与我的情况类似的问题,但没有一个有任何答案。 在您的 application.yml 中,您已定义 spring.cloud.config.server.git.search-paths 配置键。然而,从 spring 官方文档中查看this doc,关键似乎应该是 searchPaths(snakeCase,没有破折号)。 因此,我认为你的application.yml应该看起来像这样: server: port: 8081 spring: application: name: cloud-config-server cloud: config: server: monitor: github: enabled: true gitee: enabled: true git: password: ${PASSWORD} username: ${USERNAME} uri: https://github.com/Ali-Wassouf/springcloudconfigrepo searchPaths: '{application}' 问题出在客户端,缺少 Spring Cloud 配置以及 Spring Cloud 的依赖管理。 将此依赖项添加到客户端代码中 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> 并添加此依赖管理 <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 解决了问题。

回答 2 投票 0

来自云配置的 JsonTemplateLayout eventTemplateUri

我已将我的应用程序配置为使用 log4j2 配置以 JSON 形式记录: 配置: 状态:警告 附加器: 安慰: 名称: 控制台 目标:SYSTEM_OUT JsonTemplate...

回答 1 投票 0

找不到类[org.springframework.cloud.client.loadbalancer.LoadBalancerClientsProperties]

我是 Java Spring 框架的新手。我正在尝试使用配置服务中的配置属性并遵循本教程。我尝试添加两个依赖项,一个是 spring-cl...

回答 3 投票 0

动态刷新springboot配置

有没有办法在我们更改 .properties 文件后立即刷新 springboot 配置? 我遇到了 spring-cloud-config ,许多文章/博客建议将其用于分布式环境......

回答 2 投票 0

我实现的 TextEncryptor 适用于/加密/解密,但不适用于 propertySource 读取

在Spring云配置服务器中,我实现了一个自定义TextEncryptor,用我自己的加密算法来加密和解密属性(我需要像这样),并且我制作了一个TextEncryptorLoca bean...

回答 1 投票 0

在 Spring Cloud 配置服务器中转义登录

我有spring cloud配置服务器,它为rabbit提供密码。密码包含“@”。当我使用 static appliation.yaml 运行应用程序时,我必须用 '' 包围值 春天: 兔子MQ:

回答 1 投票 0

无法使用执行器刷新来更新值配置服务器

当我尝试使用执行器/刷新刷新 git 上的配置服务器时遇到问题 这是我在配置客户端中使用的依赖项 依赖项{ 实现 'org.springframework.boot:sprin...

回答 1 投票 0

ApplicationContext 未在 /actuator/refresh 期间为 ApplicationContextInitializer 的回调提供 application.properties 属性源

应用程序上下文的环境未在 /actuator/refresh 结束期间向 ApplicationContextInitializer 实现的回调提供基于 application.properties 的属性源...

回答 1 投票 0

Spring-boot 3 onfig 服务器客户端尝试 localhost:8888,即使 URL 已正确配置

在 stack-overflow 中也提出了同样的问题,但没有找到正确的解决方案。我的应用程序中有以下配置。它抱怨同样的问题,甚至卡住了,如果有的话

回答 1 投票 0

Spring Profile Active 未设置

我正在尝试运行以下命令来启动 springboot 应用程序 java -Dlog4j.configuration=file:///log4j.properties -Dspring.profiles.active=local -cp ./target/app-1.0.0-SNAPSHOT-jar-with-

回答 1 投票 0

spring cloud配置服务器无法绑定到gitlab

我正在使用 Spring springCloudVersion,“2021.0.3”来设置一个配置服务器,该服务器使用我的 gitlab 帐户来存储其文件。我创建了一个具有权限的部署令牌: 读取存储库、读取注册表...

回答 2 投票 0

如何在 Spring Boot 中加密 {cipher} 的值?

我知道如何使用Jasypt 但我了解到 Spring Stack 中有使用密码的替代方案: security.user.password: '{cipher}56e611ce4a99ffd99908d2c9aa1461d831722812e4370a5b6900b7ea680ae914'...

回答 2 投票 0

propertySources 显示为空(Spring Cloud 配置)

我正在尝试学习Spring Cloud。所以我使用 Spring Starter 创建了一个新项目(一个非常基本的项目) 我像这样配置了我的 application.properties : 服务器端口=9090 spring.cloud.config.server.nat...

回答 5 投票 0

无法从“可选:configserver:http://localhost:8090 - SpringBoot 2.4.0 Illford 2020.0.0-M3”加载配置数据

关于新的SpringBoot 2.4.0的问题。 首先,我们将配置服务器和配置客户端升级到 SpringBoot 2.4.0 + Illford 2020.0.0-M3 然后,我们就按照set的“新方式”...

回答 2 投票 0

Spring Cloud Gateway 和 Feign Client 的异步调用问题

我的 Spring Cloud Gateway 设置面临一个问题,其中配置为遍历多个服务的 GET 端点不等待下游服务的响应。具体来说,我有一个...

回答 1 投票 0

使用 svn 作为存储库的 spring-cloud-config-server 的奇怪问题

我正在使用 spring-cloud-config-server 和 SVN 作为存储库。当我启动云配置服务器和客户端[微服务]时,配置值被正确获取。 更改配置后

回答 2 投票 0

使用Spring Cloud配置服务器时无法加载Web服务application.properties

我有一个使用 github 运行的 Spring Cloud 配置服务器和一个管理用户的 Web 服务。 用于此测试项目的当前版本是: 弹簧启动3.2.1 春云 我有一项服务使用...

回答 1 投票 0

如何使用Spring Cloud Config Server集中log4j2配置

我正在使用 Spring Cloud 配置服务器文件系统后端:docs.spring.io 我有一个多 Maven 项目 项目: ├── pom.xml │ ├── 项目配置提供者 │ ├── pom.xml │ ├── 源代码 │ │ └── 麦...

回答 1 投票 0

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