-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add auto-configuration for Hazelcast #2942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What should I not forget? Checking for |
I don't understand what you mean, sorry. Please clarify. |
Hello, @snicoll ! Sorry, for delay. Realy have missed this ticket somehow... Was busy outside of Hazelcast stuff 😄 Regarding Spring Cloud: I meant just keep it in mind that it is one more Spring Portfolio projects which uses Hazelcast and Boot. Although, as we see by their code, it does that wrong way - without any
Yes, I think so. Something similar what you do in the
The instance may look like this:
and so on. |
okay so checking for the presence of |
👍 for this enhancement. And if possible (though I know the release date for RC1 is quickly approaching), I'd love to see this in 1.3. |
@snicoll Would it be worth opening a separate issue for basic Hazelcast auto-configuration? I mostly just want to use it with Spring Session and possibly as an in-memory data grid. This seems to be a more basic requirement than supporting Spring Integration. Then perhaps that could be included in 1.3 (I would be willing to work on a PR), while the SI parts wait until 1.4? |
@shakuzen I've already started and this issue has no SI bits at all. The purpose was to allow SI to smoothly integrate with it. In other words, this issue is the "basic" requirement you're mentioning. It would be nice if you could try it once it's done so that we get a chance to improve it if necessary. |
Provide a general purpose Hazelcast integration (i.e. not tied to caching). Auto-configure a `HazelcastInstance` either based on the presence of a `Config` bean or a configuration file. Said configuration file can be specified explicitly or automatically found from default locations. The cache integration already supports Hazelcast so it has been reworked to automatically reuse an existing `HazelcastInstance` if available. Closes spring-projectsgh-2942
Extract a HazelcastInstanceFactory class and cleanup some formatting. See gh-2942
This was the original intent of #2848 but unfortunately the actual discussion moved to another direction.
Hazelcast can be used for "non-caching" scenario. In particular,
spring-integration
has a specific Hazelcast integration. This integration needs theHazelcastInstance
as a@Bean
definition and it does not need to be necessarily coupled with caching. So it should work even ifHazelcastCacheManager
is not present and if@EnableCaching
has not been specified.This brings some interesting use cases:
Since
HazelcastInstance
provides cache-related features and other features, we would need to move the processing to a dedicated auto-configuration. We should probably integrate the caching-related bits in there if need to be (i.e.HazelcastAutoConfiguration
has a dependency to the caching support, i.e.CachingProperties
).spring.cache.config
should probably move away tospring.cache.hazelcast.config
,spring.cache.ehcache.config
andspring.cache.jcache.config
and a newspring.hazelcast.config
should be created. The mere presences of two separate properties would allow to create twoHazelcastInstance
if need to be. The condition to figure that out won't be easy to implement though.Remains one last issue related to JCache. If we use
Hazelcast
andJCache
for caching with hazelcast behind the scenes, we may bootstrap twoHazelcastInstance
while the user may expect the same configuration to be used with a single instance. Not sure yet if that's a problem and how to handle it.The text was updated successfully, but these errors were encountered: