首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Spring的RabbitMQ高可用性

使用Spring的RabbitMQ高可用性
EN

Stack Overflow用户
提问于 2013-11-25 14:41:55
回答 1查看 816关注 0票数 0

我试图在Spring中配置一个RabbitMQ集群,因此我遵循Spring (http://docs.spring.io/spring-amqp/reference/html/amqp.html),但添加地址时出错:

代码语言:javascript
复制
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                    http://www.springframework.org/schema/rabbit
                    http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd">

<rabbit:connection-factory id="connectionFactory" addresses="host1,host2" />

我在gradle中定义的依赖项:

代码语言:javascript
复制
compile group: 'org.springframework.amqp', name: 'spring-amqp', version:'1.2.0.RELEASE'
compile group: 'org.springframework.amqp', name: 'spring-rabbit', version:'1.2.0.RELEASE'

有人知道为什么会这样吗?谢谢!

编辑:我得到的错误是:cvc-复合- The .3.2.2:属性‘地址’不允许出现在元素‘兔子:连接-工厂’。host1和host2是虚拟机的IP。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-25 15:19:52

这是因为您在schemaLocation中为1.0版本声明了Spring-兔子XSD文件。只要改变:

http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd

http://www.springframework.org/schema/rabbit/spring-rabbit-1.2.xsd

与你的春兔版相匹配,而且应该能用。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20195850

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档