RabbitConnectionFactory maven依赖

时间:2017-07-07 11:52:07

标签: rabbitmq spring-rabbit

为了使用RabbitConnectionFactory,我需要哪些依赖项?我有下面的pom,但RabbitConnectionFactory无法解析:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.rabbit</groupId>
<artifactId>connector</artifactId>
<version>0.0.1-SNAPSHOT</version>


<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.4.RELEASE</version>
</parent>
<dependencies>
    <dependency>
        <groupId>org.springframework.amqp</groupId>
        <artifactId>spring-rabbit</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-cloudfoundry-connector</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-spring-service-connector</artifactId>
        </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-cloudfoundry-connector</artifactId>
    </dependency>
</dependencies>

我的回购在这里: https://github.com/pkid/rabbitconnectionfac

提前感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

没有这样的课程RabbitConnectionFactory

你在哪里看到错误?

使用spring-rabbit,您通常会使用其CachingConnetionFactory。它使用amqp-client库中的基础ConnectionFactory,这是一个传递依赖。

spring-cloud-service-connector,在RabbitConnectionFactoryCreator中创建这些对象的实例。