• Stephane Nicoll's avatar
    Fix Hazelcast Cache auto-configuration ordering · 094f7aa2
    Stephane Nicoll authored
    Spring Boot supports the automatic configuration of an additional
    HazelcastInstance if one already exists and an explicit property has been
    set to use a different configuration for caching. So three cases are
    supported really: no `HazelcastInstance` exists so we need to create one
    anyway or an `HazelcastInstance` already exists; in that latter case, we
    should either reuse it or create a new one.
    
    Unfortunately, the conditions that checked those three use cases were
    not ordered consistently and we could easily get in a situation where
    both conditions were evaluated.
    
    This commit makes sure that we  first check if an `HazelcastInstance`
    exists and then (and only then) we create the missing `HazelcastInstance`
    used for caching. The tests have also been improved to validate the
    proper `HazelcastInstance` is used for caching.
    
    Closes gh-5181
    094f7aa2
Name
Last commit
Last update
..
src Loading commit data...
pom.xml Loading commit data...