我下面的这个指南,但使用简单的消息代理,而不是http://spring.io/guides/gs/messaging-stomp-websocket/,我想用蹬经纪人继电器春天开机+ ActiveMQ的+跺脚经纪人中继连接失败
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableStompBrokerRelay("/topic").setRelayHost("stomp://localhost").setRelayPort(61612);
registry.setApplicationDestinationPrefixes("/app");
}
和我试图但是我的控制台一直显示连接失败
2016年2月26日01:38:05.786 INFO 3584 --- [主] osmssStompBrokerRelayMessageHandler:连接 “系统” 会议上跺脚://本地主机:61612
2016-02-26 01:38:05.942信息3584 --- [eactor-tcp-io-1] r.io.net.impl.netty.tcp.NettyTcpClient:无法连接到stomp:// localhost:61612 。尝试在5000毫秒内重新连接。
2016-02-26 01:38:05.957 INFO 3584 --- [main] o.s.m.s.s.StompBrokerRelayMessageHandler:Started。
2016年2月26日01:38:06.025 INFO 3584 --- [主要] sbcetTomcatEmbeddedServletContainer:Tomcat的开始端口(一个或多个):8052(HTTP)
2016年2月26日1点38: 06.025 INFO 3584 --- [main] main.java.test.TestApplication:在9.419秒内启动TestApplication(JVM运行15.121)
2016-02-26 01:38:11.022信息3584 --- [eactor- tcp-io-2] r.io.net.impl.netty.tcp.NettyTcpClient:无法连接到stomp:// localhost:61612。尝试在5000毫秒内重新连接。
2016-02-26 01:38:16.008信息3584 --- [eactor-tcp-io-3] r.io.net.impl.netty.tcp.NettyTcpClient:未能连接到stomp://本地主机:61612。尝试在5000毫秒内重新连接。
我activemq.xml中,除了这个默认:
<transportConnectors>
<transportConnector name="stomp" uri="stomp://localhost:61612"/>
</transportConnectors>
ActiveMQ的,没有任何问题,因为我能够以http://localhost:8161/admin连接到管理页面启动。
这里是万一有人我看到maven pom.xml察觉出来,我可能是使用了错误的依赖
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd “> 4.0.0
<groupId>com.test.program</groupId>
<artifactId>testapp</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>2.0.7.RELEASE</version>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-net</artifactId>
<version>2.0.7.RELEASE</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>4.0.34.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>4.0.34.Final</version>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/libs-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestone</id>
<url>https://repo.spring.io/libs-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
你检查跺脚传输连接器是启动和运行,ActiveMQ的管理页面可能可以访问,请检查运输连接器 – Sundar
是那里检查一种特殊的方式?据我所知它不会在控制台中显示任何地址绑定错误,当我启动activemq。 – ron