I have a spring boot application and it receives stomp over websocket topic subscriptions from clients that which will be routed to my embedded activemq broker.
My code to start my embedded activemq broker
@SpringBootApplication
public class RttApplication {
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext ctx = SpringApplication.run(RttApplication.class, args);
BrokerService brokerService = new BrokerService();
brokerService.setPersistent(false);
brokerService.setUseJmx(false);
brokerService.addConnector("vm://localhost:0");
brokerService.setBrokerName("event");
brokerService.start();
}
}
My spring broker relay configuration class
@Configuration
@EnableWebSocketMessageBroker
public class MessageBrokerConfigurer extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/event").withSockJS();
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableStompBrokerRelay("/topic").setRelayHost("vm://localhost").setRelayPort(0);
registry.setApplicationDestinationPrefixes("/app");
}
}
But it's showing this when I start up the application
2016-02-25 15:44:34.678 INFO 7604 --- [ main] o.a.activemq.broker.TransportConnector : Connector vm://localhost:0 Started
2016-02-25 15:44:34.694 INFO 7604 --- [ main] o.apache.activemq.broker.BrokerService : Apache ActiveMQ 5.7.0 (event, ID:PC13082-53189-1456386274543-0:1) started
2016-02-25 15:44:34.694 INFO 7604 --- [ main] o.apache.activemq.broker.BrokerService : For help or more information please see: http://activemq.apache.org
2016-02-25 15:44:39.532 INFO 7604 --- [eactor-tcp-io-2] r.io.net.impl.netty.tcp.NettyTcpClient : Failed to connect to vm://localhost:0. Attempting reconnect in 5000ms.
application.propertiesand you are done. - M. Deinum