spring-boot: HazelcastAutoConfiguration conflict with @EnableCaching

See http://stackoverflow.com/questions/42151600/hazelcast-and-jcache-in-spring-boot-creates-two-instances?noredirect=1#comment71527698_42151600

If @EnableCaching is used with Hazelcast as the caching provider, a Hazelcast instance is created. Spring Boot’s HazelcastAutoConfiguration should not then create another.

Possible fix might be to test for a JCacheCacheManager bean being a Hazelcast instance.

Example code to reproduce, https://github.com/hazelcast/hazelcast-code-samples/tree/stackoverflow42151600/hazelcast-integration/springboot-caching-jcache and run the startBootifulMember.sh script.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Looking at the sample @dirkvanrensburg has provided, I can see what the original problem is (see #8467) for a better description. If the instance name is set we will reconciliate the two instance and the fact you don’t get that from the URI is a limitation in Hazelcast. So I am going to close this issue again. The issue Dirk has is real but I don’t think your sample is legit, given the current limitation in Hazelcast. Let me know if I’ve missed anything.