| For the latest stable version, please use Spring Boot 3.5.5! | 
Hazelcast
If Hazelcast is on the classpath and a suitable configuration is found, Spring Boot auto-configures a HazelcastInstance that you can inject in your application.
Spring Boot first attempts to create a client by checking the following configuration options:
- 
The presence of a ClientConfigbean.
- 
A configuration file defined by the spring.hazelcast.configproperty.
- 
The presence of the hazelcast.client.configsystem property.
- 
A hazelcast-client.xmlin the working directory or at the root of the classpath.
- 
A hazelcast-client.yaml(orhazelcast-client.yml) in the working directory or at the root of the classpath.
If a client can not be created, Spring Boot attempts to configure an embedded server.
If you define a 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 configuration file to use through configuration, as shown in the following example:
- 
Properties 
- 
YAML 
spring.hazelcast.config=classpath:config/my-hazelcast.xmlspring:
  hazelcast:
    config: "classpath:config/my-hazelcast.xml"Otherwise, Spring Boot tries to find the Hazelcast configuration from the default locations: hazelcast.xml in the working directory or at the root of the classpath, or a YAML counterpart in the same locations.
We also check if the hazelcast.config system property is set.
See the Hazelcast documentation for more details.
| By default, @SpringAwareon Hazelcast components is supported.
TheManagedContextcan be overridden by declaring aHazelcastConfigCustomizerbean with an@Orderhigher than zero. | 
| Spring Boot also has explicit caching support for Hazelcast.
If caching is enabled, the HazelcastInstanceis automatically wrapped in aCacheManagerimplementation. |