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

问题描述 投票:0回答:1

我有 Spring Cloud 配置服务器,它为 Rabbit 提供密码。密码包含“@”。当我使用 static appliation.yaml 运行应用程序时,我必须用 ''

包围值
spring:
  rabbitmq:
  addresses: localhost:5672
  username: guest
  password: '@xxx'

但是当我从配置服务器获取它时,使用 jdbc 存储,密码不匹配。我尝试了很多方法来撤离“@”但没有成功。

rabbitmq spring-cloud spring-amqp spring-rabbit spring-cloud-config
1个回答
0
投票

尝试使用以下选项之一来逃避

@

使用反斜杠

password: mypass\\@secure

或使用编码

%40

password: mypass%40secure
© www.soinside.com 2019 - 2024. All rights reserved.