【问题标题】:RabbitMQ connectionFactory - wrong scheme in amqp URI:RabbitMQ connectionFactory - amqp URI 中的错误方案:
【发布时间】:2015-03-13 11:05:08
【问题描述】:

我们使用 Cloud Foundry 提供了一个 rabbitMQ 服务,它看起来像这样: “amqp+ssl”:{ “主机”:xxx, “密码”:xxxx “端口”: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);
    }

如果有人有一个小代码sn-p如何正确使用spring cloud,那就太好了。我已经注意到 spring-cloud-connectors 的存在,但是没有示例如何使用它......只有如何使用和创建自定义服务连接器!?

感谢您的帮助和时间。

弗拉基米尔

【问题讨论】:

    标签: spring-cloud


    【解决方案1】:

    此问题很可能是由较低版本的 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 部分可以覆盖显式设置的依赖项。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-24
      • 1970-01-01
      • 1970-01-01
      • 2021-04-30
      • 1970-01-01
      • 2016-12-09
      • 2013-03-07
      • 1970-01-01
      相关资源
      最近更新 更多