【问题标题】:RabbitMQ JAVA Spring Configurations - spring.rabbitmq.ssl.key-storeRabbitMQ JAVA Spring 配置 - spring.rabbitmq.ssl.key-store
【发布时间】:2021-04-07 10:01:07
【问题描述】:

我正在尝试将我的 Spring 应用程序连接到 RabbitMQ 服务器。 我的 src/main/resources 文件夹中有一个 application.properties 文件,其中包含以下属性:

spring.rabbitmq.port=port
spring.rabbitmq.username=user
spring.rabbitmq.password=pass
spring.rabbitmq.host=hostname
spring.rabbitmq.ssl.verify-hostname=true
spring.rabbitmq.virtual-host=virtualHost
spring.rabbitmq.ssl.enabled=true
spring.rabbitmq.ssl.algorithm=TLSv1.2
spring.rabbitmq.ssl.key-store=client-file
spring.rabbitmq.ssl.key-store-password=client

“客户端文件”也在同一目录中 - src/main/resources。但是,当我构建应用程序时 - 我收到以下错误:

Factory method 'rabbitConnectionFactory' threw exception; 
nested exception is org.springframework.amqp.AmqpIOException: java.io.FileNotFoundException: 
class path resource [client-file] cannot be opened because it does not exist

我的文件未被识别...我可能需要一些完整路径,但不确定它应该是什么样子。任何帮助将不胜感激!

【问题讨论】:

  • 你好@Uri Shapira,你能解决你的问题吗?

标签: java spring spring-boot ssl rabbitmq


【解决方案1】:

试试这样:

...
spring.rabbitmq.ssl.key-store=classpath:/client-file
spring.rabbitmq.ssl.key-store-password=client

我确实把我的放在资源文件夹'..\src\main\resources'中。

【讨论】:

    【解决方案2】:

    如果您将文件放在应用程序外部的目录位置(或安装的驱动器),请使用 file:file_path。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 2017-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-01
      相关资源
      最近更新 更多