-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: make adding a main application optional #91
Conversation
Since most operator applications don't really need to do anything in the main method besides calling `start` on Operator, make it possible to not provide a `QuarkusApplication` at all, thus removing more boilerplate.
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.
LGTM!
|
||
// if the app doesn't provide a main class, add the StartupListener | ||
if (index.getAllKnownImplementors(DotName.createSimple(QuarkusApplication.class.getName())).isEmpty()) { | ||
additionalBeans.produce(AdditionalBeanBuildItem.unremovableOf(StartupListener.class)); |
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.
Actually, you might want to add the scope here, which is likely @Singleton
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.
Better to add the scope on the class or add it when the bean is produced?
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.
Since you are conditionally registering it as a bean, I propose doing it here
136b8ee
to
7ae4cc7
Compare
Since most operator applications don't really need to do anything in the
main method besides calling
start
on Operator, make it possible to notprovide a
QuarkusApplication
at all, thus removing more boilerplate.