Spring 4.2.x, Spring Boot and the Stomp broker relay

Be aware of additional dependencies you’ll need
November 17, 2015 by Michael

If you’re using a StompBrokerRelay on the MessageBrokerRegistry, be careful with your dependencies:

If you’re using Spring Boot 1.2.x, you must have

<dependency>		
    <groupId>org.projectreactor</groupId>		
    <artifactId>reactor-net</artifactId>		
</dependency>

on the classpath, in case of Spring Boot 1.3.x, which depends on Spring 4.2 which depends on Reactor 2, it must be

<dependency>
    <groupId>io.projectreactor</groupId>
    <artifactId>reactor-net</artifactId>        
</dependency>   
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.0.31.Final</version>
</dependency>

in addition to org.springframework:spring-messaging respectively org.springframework.boot:spring-boot-starter-websocket otherwise you’ll end with a bunch of missing class exceptions: reactor.io.encoding.Codec in case of 1.2 and reactor.o.codec.Codec in case of 1.3.

I find this pretty inconvenient and i wish the web socket starter would include them.

Edit: Andy was so kind opening an issue for that topic: https://github.com/spring-projects/spring-boot/issues/4522. Stomp Starter would be equally useful.

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *