0

我们使用 Cloud Foundry 配置了 rabbitMQ 服务,它看起来像这样:“amqp+ssl”:{“host”:xxx,“password”:xxxx“port”:5671,“ssl”:true,“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 cloud,那就太好了。我注意到 spring-cloud-connectors 的存在,但是没有示例如何使用它......只有如何使用和创建自定义服务连接器!?

感谢您的帮助和时间。

弗拉基米尔

4

1 回答 1

0

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

于 2015-08-18T09:37:44.707 回答