Hazelcast instance discovery in Spring eco boot system

Background:

We have a set of approximately 15 Spring boot applications as microservices. They all work as Docker containers and run as clusters of one or more instances. We also use Spring Cloud Netflix components, such as Eureka, and discover executable application instances from the client using the Fign / Ribbon function.

Question:

As part of the POC exercises, we tested Redis and Hazelcast for caching and Spring boot storage. Everything works using Spring Boot, Spring Cloud, and Redis / Hazelcast Java client libraries. However, when deploying Hazelcast in a multi-tier multi-node cluster, Hazelcast apparently requires a “known” IP address / host name, and the available port must be available in the Java client configuration (with or without Spring). Typically, when a Hazelcast is deployed in a multi-instance cluster on ephemeral VM instances (such as EC2), the IP address and port information are not available. Therefore, we thought of two possible solutions:

  • Find a way to launch Hazelcast as a Spring boot application and register it with Eureka as a Discovery Client. Thus, other Spring Boot applications can use Eureka to dynamically open a Hazelcast instance.

  • Find a way in Hazelcast so that it can publish its IP address and port information dynamically in a central repository of keys / values

If someone played with Hazelcast to be able to make one of two possible decisions, it would be great if you could share more information about it. If there is a third approach that works better, I will also know about it.

+5
source share

Source: https://habr.com/ru/post/1235594/


All Articles