How to do it...

Let us create a simple messenger by performing the following steps:

  1. First, convert ch12-websocket to the Spring Boot 2.0 application by to pom.xml the Spring Boot 2.0.0.M2 starter POM dependencies, such as Spring WebFlux for Reactive components and Spring Boot actuator for project status monitoring and management.
  2. To add support for the websocket protocol, add the following starter POM dependency in pom.xml:
<dependency> 
   <groupId>org.springframework.boot</groupId> 
   <artifactId>spring-boot-starter-websocket</artifactId> 
</dependency> 
  1. To convert message payloads in JSON format to Java objects, add the following additional Maven dependency:
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> ...

Get Spring 5.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.