I tried to make STOMP connection to RabbitMQ using Spring 4.0 WebSocketMessageBrokerConfigurer class, but failed ?
Snap of code is here.
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
StompBrokerRelayRegistration StompBrokerRelayRegistration = config.enableStompBrokerRelay("/");
StompBrokerRelayRegistration.setApplicationLogin("guest");
StompBrokerRelayRegistration.setApplicationPasscode("guest");
StompBrokerRelayRegistration.setAutoStartup(true);
StompBrokerRelayRegistration.setRelayHost("localhost");
StompBrokerRelayRegistration.setRelayPort(15674);
Note that
- I am using spring boot to run application. In fact I am changing the existing spring example "gs-messaging-stomp-websocket". and changing class WebSocketConfig.
- Rabbitmq is locally installed with STOMP plugin enabled.
- Added all the maven dependency like spring-rabbitmq.
Do I need to do any thing else ?
Thanks, Rafiq