If Hazelcast is on the classpath and a suitable configuration is
found, Spring Boot auto-configures a
HazelcastInstance that you can inject in your
If you define a
com.hazelcast.config.Config bean, Spring Boot uses that. If your
configuration defines an instance name, Spring Boot tries to locate an existing instance
rather than creating a new one.
You could also specify the
hazelcast.xml configuration file to use through
configuration, as shown in the following example:
Otherwise, Spring Boot tries to find the Hazelcast configuration from the default
hazelcast.xml in the working directory or at the root of the classpath. We
also check if the
hazelcast.config system property is set. See the
Hazelcast documentation for
hazelcast-client is present on the classpath, Spring Boot first attempts to create a
client by checking the following configuration options:
- The presence of a
- A configuration file defined by the
- The presence of the
hazelcast.client.config system property.
hazelcast-client.xml in the working directory or at the root of the classpath.