I was able to get Hazelcast caching working in my Spring Boot application with a hazelcast.xml file. However, the application has multiple profiles and I'm trying to avoid managing multiple hazelcast.xml files. I want to configure all of the options within the application.yml. If I understand the documentation correctly, I should be able to do the following in my application.yml, correct?
hazelcast:
client:
config:
network:
join:
tcp-ip:
member:
- 1.2.3.4
- 9.8.7.6
map:
name: user-details
max-size: 1000
eviction-policy: LRU
eviction-percentage: 10
time-to-live-seconds: 900
Except it's not working. I've tried finding other references to configuring Hazelcast through the application.yml but have found none. Is what I'm trying to do impossible?
I faced the same issue and added a configuration class for this:
@Configuration
@EnableConfigurationProperties(HazelcastConfig::class)
@ConfigurationProperties(prefix = "hazelcast", ignoreUnknownFields = false)
@Primary
class HazelcastConfig: Config()
And then I just put this in the application.yml:
hazelcast:
group_config:
name: hazelcast-cluster
password: hazelcast-cluster
network_config:
join:
multicast_config:
enabled: false
kubernetes_config:
enabled: false
(Yes I know it is an old question but it is the most popular according to Google)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With