Creating a chat service to handle WebSocket traffic
If we visit http://start.spring.io, select Gradle, Spring Boot 2.0, Eureka Discovery, Config Client, Stream Rabbit, Lombok, and Reactive Web, we'll have a nice little service ready to chat:
compile('org.springframework.boot:spring-boot-starter-webflux') compile('org.projectlombok:lombok') compile('org.springframework.cloud:spring-cloud-starter-stream- rabbit') compile('org.springframework.cloud:spring-cloud-stream-reactive') compile('org.springframework.cloud:spring-cloud-starter-eureka') compile('org.springframework.cloud:spring-cloud-starter-config')
These aforementioned dependencies in our new chat service can be described as follows:
spring-boot-starter-webflux
: This comes with a Reactive Streams capable WebSocket APIlombok
: This is the library that gets us out of the business of coding getters, setters, and other boilerplate Java codespring-cloud-starter-stream-rabbit
: This is the Spring Cloud Stream...