-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Disable auto-configuration of Hazelcast IMDG when Hazelcast Jet is present #20729
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
Disable auto-configuration of Hazelcast IMDG when Hazelcast Jet is present #20729
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. If the purpose of this is to make sure HazelcastInstance
is not created, I'd rather put that condition on HazelcastAutoConfiguration
itself as that's the only thing it does.
@@ -43,6 +46,16 @@ protected HazelcastConfigResourceCondition(String configSystemProperty, String.. | |||
this.configSystemProperty = configSystemProperty; | |||
} | |||
|
|||
@Override | |||
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code doesn't match with the javadoc or name of HazelcastConfigResourceCondition
so it shouldn't be located there.
* | ||
* @author Ali Gurbuz | ||
*/ | ||
@ClassPathOverrides("com.hazelcast.jet:hazelcast-jet:4.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer no to refer to a concept if we can avoid doing so. This test could be put in the main test with a special ClassLoader
that returns the expected resource and shows the hazelcast instance is not created.
@gurbuzali are you aware a colleague of yours has already submitted an attempt? see #19483. Ignoring the class check, I think it's more aligned with what we need to do there (besides testing as I've mentioned in a comment). |
…resent on the classpath
Hi @snicoll, I've tried to address your review comments, please take a look. |
Thank you for making your first contribution to Spring Boot. |
Spring Boot auto-configures Hazelcast IMDG when it finds relevant configuration file on the classpath or root directory. Hazelcast Jet wraps IMDG and uses the very same configuration files(in addition to Hazelcast Jet specific configuration file) to configure and create Hazelcast Jet instances. This PR disables Hazelcast IMDG auto-configuration if Jet presents by checking a certain file (
hazelcast-jet-default.yaml
) is on the classpath.See discussion on this PR #19483
fixes hazelcast/hazelcast-jet#1835
See Hazelcast Jet Starter Spring Boot Starter