Let us create a simple messenger by performing the following steps:
- 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.
- 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>
- 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> ...