How to do it...

Let us assume that there is a distributed setup of microservices, which can dockerized or not, just for us to apply the following steps in building Hazelcast caching:

  1. Open the pom.xml file of the ch12-hiber project and add the following Spring Cache starter POM dependency, as follows:
<dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-cache</artifactId> 
</dependency> 
  1. Then, add the Spring Boot 2.0 starter POM for Hazelcast support. Also, include the updated and stable version of the Hazelcast-Spring external libraries needed to configure the Hazelcast cache manager for the Spring 5 application, as follows:
<dependency> <groupId>com.hazelcast</groupId> <artifactId>hazelcast</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.