RabbitMQ connectionFactory - amqp URI 中的错误方案:
RabbitMQ connectionFactory - wrong scheme in amqp URI:
我们使用 Cloud Foundry 提供了一个 rabbitMQ 服务,它看起来像这样:
"amqp+ssl":{
"host": xxx,
"password":xxxx
"port": 5671,
"ssl": 是的,
"uri": "amqps:/......
当我推送我的应用程序时出现错误:amqp URI 中的方案错误...
有人知道如何更改方案吗,因为我需要 amqps?
现在我得到了这个:
@Configuration
@ServiceScan
@Profile("cloud")
public class CloudConfig extends AbstractCloudConfig {
@Bean
public ApplicationInstanceInfo applicationInfo() {
return cloud().getApplicationInstanceInfo();
}
@Bean
public ConnectionFactory rabbitConnectionFactory(){
// I would say here I have to configure the amqp connectionFactory??
// But how? :(
return connectionFactory;
}
@Bean
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory){
return new RabbitTemplate(connectionFactory);
}
如果有人知道如何使用 spring 云正确执行此操作的小代码片段,那就太好了。我注意到 spring-cloud-connectors 的存在,但是没有示例如何使用它...只有如何使用和创建自定义服务连接器!?
感谢您的帮助和时间。
弗拉基米尔
这个问题很可能是由 spring-cloud-core
的低版本引起的。 1.1.1.RELEASE 之前的任何版本都无法识别 amqps
方案。
而且,由于此工件通常是 spring-cloud-connectors 的依赖项,因此这些工件的版本也应等于或大于 1.1.1.RELEASE。如果配置了 spring-boot pom parent,您还需要注意任何具有 spring-boot-dependencies
的工件的版本。它需要等于或大于 1.1.1.RELEASE 因为有一个 dependencyManagement
部分可以覆盖显式设置的依赖项。
我们使用 Cloud Foundry 提供了一个 rabbitMQ 服务,它看起来像这样: "amqp+ssl":{ "host": xxx, "password":xxxx "port": 5671, "ssl": 是的, "uri": "amqps:/......
当我推送我的应用程序时出现错误:amqp URI 中的方案错误...
有人知道如何更改方案吗,因为我需要 amqps?
现在我得到了这个:
@Configuration
@ServiceScan
@Profile("cloud")
public class CloudConfig extends AbstractCloudConfig {
@Bean
public ApplicationInstanceInfo applicationInfo() {
return cloud().getApplicationInstanceInfo();
}
@Bean
public ConnectionFactory rabbitConnectionFactory(){
// I would say here I have to configure the amqp connectionFactory??
// But how? :(
return connectionFactory;
}
@Bean
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory){
return new RabbitTemplate(connectionFactory);
}
如果有人知道如何使用 spring 云正确执行此操作的小代码片段,那就太好了。我注意到 spring-cloud-connectors 的存在,但是没有示例如何使用它...只有如何使用和创建自定义服务连接器!?
感谢您的帮助和时间。
弗拉基米尔
这个问题很可能是由 spring-cloud-core
的低版本引起的。 1.1.1.RELEASE 之前的任何版本都无法识别 amqps
方案。
而且,由于此工件通常是 spring-cloud-connectors 的依赖项,因此这些工件的版本也应等于或大于 1.1.1.RELEASE。如果配置了 spring-boot pom parent,您还需要注意任何具有 spring-boot-dependencies
的工件的版本。它需要等于或大于 1.1.1.RELEASE 因为有一个 dependencyManagement
部分可以覆盖显式设置的依赖项。