To configure Hazelcast applications, you can choose either static or dynamic configuration. Explore the options and decide which one is best for your application.
Before configuring Hazelcast, we recommend trying the defaults, which are set in the
hazelcast-default.xml file of your Hazelcast package.
Static configuration allows you to configure Hazelcast before runtime by providing either configuration files or using the API. Static configuration cannot be changed during runtime.
To use static configuration, you have the following options:
Declarative configuration: Use configuration files to configure a Hazelcast cluster before starting it.
Programmatic configuration: Use the Java API to configure a cluster in embedded mode.
System properties: Use system properties to configure some aspects of Hazelcast.
Spring configuration: Configure Hazelcast for Spring integration.
The following topics are also relevant to static configuration:
Hazelcast performs schema validation through the
which comes with Hazelcast libraries. If an error occurs in declarative or programmatic configuration, Hazelcast throws a meaningful exception.
Hazelcast looks for static configuration options in the following order:
Configobject provided by programmatic configuration
hazelcast.xmldeclarative configuration file in the working directory
hazelcast.xmldeclarative configuration file on the classpath
.yml) declarative configuration file in the working directory
hazelcast.yamldeclarative configuration file on the classpath
If Hazelcast does not find any of these configuration options, it loads the default configuration file (
hazelcast-default.xml), which comes with your Hazelcast package.
Dynamic configuration allows you to temporarily change the configuration of some data structures.
For more information, see Dynamically Adding Data Structure Configuration on a Cluster.