-
Notifications
You must be signed in to change notification settings - Fork 186
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
Revisit camel-quarkus bootstrap #1128
Comments
An older comment by me that got obsolete by Luca's update https://github.com//issues/1128#issuecomment-618407713. Click to expand> * embedded (core) > > * routes are added to the camel context directly... by the user
... by the user
By whom?
... by the user? Which aspects of the context for example?
My standpoint is the same as in the past when we were introducing the main: If 80+% of Camel Quarkus users will be supposed to add dependency X, then the dependency should be present by default and the users do not need to know about the fine tuning unless they know what they do. Requiring a decision from the end users will cause unnecessary cognitive load and confusion. Having said that I vote for configuring core vs. main via application.properties rather than via dependencies. My very naive initial attitude to main vs. static is that we should have only one of them, probably only static. "some limitation may happen" could be presented as limitations of Camel Quarkus rather than a limitation of the single "static" mode. If ppl. need more flexibility they should be advised to choose another Camel platform. |
I think you get this wrong as my proposal is to revisit the boostrap in general so if you don't have main as extension, then camel will still start the camel context and will still auto discovery routes as it does today, what it will lacks is some bits that are supported by camel main which you cna leverage by adding the main extension. static initit cane become the default only if it does not break other runtimes i.e. camel-k so I'd say the default should be what would for for the majority and you should opt for the static and more optimized options if you are conscious about what you are doing. |
Could you please edit your proposal and clearly split
|
@ppalaga updated the issue |
So this is the same as the CamelMain.start() currently ?
How can we support this customizer with CDI beans ? provide the BeanConfigurationBuildItem in the user's application code ? I just introduce the |
Except it does not use camel-main
mh, probably we don't need it as we fire CDI events so one can listen and react to them.
The default bootstrapper should be marked as optional so developers can provide an alternative one if they want a custom boostrap logic |
This looks like to add a similar CdiEventNotifier in camel context during the building time ? |
yeah, something like that but we need to think a little about it |
Thanks for the update, @lburgazzoli , it makes much more sense to me now. Could you please confirm/deny/explain the following?
|
correct
correct
this is very hard to answer as there's many way to use camel, using main to create a standalone camel application is certainly one option but you can also use some little camel from smallrye-reactive-messaging or mutiny or when you need some small integration capabilities in your application. I think that nowadays it is likely common to require some integration capabilities so I believe having a core that helps setting up things but give you freedom to i.e. provide your own main is the most sensible choice we can make.
I think there have been some discussion on quarkus side to have a way to add additional artefacts depending on some conditions but I'd rather start with something simple and less magic and see how it goes. |
@ppalaga are the info here good enough to start working on the implementation ? |
One more question: |
Additional note, there is an issue about move component auto configuration as part of standard component life-cycle which would make revisiting the bootstrap process even more appealing as configuring components/languages/etc with be available out of the box with less overhead |
@lburgazzoli is there any update on this issue ? |
I'm workign on a big refactor :) |
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Co-authored-by: Peter Palaga <ppalaga@redhat.com>
Current State
The camel-quarkus-core extension has two main responsibilities:
Camel's main support is an optional feature enabled by default that in essence:
With the introduction of the lightweight camel context in camel 3.2 and the work that is planned for for next versions the code may becoming more complex to maintain and the number of option may raise making the configuration harder for user.
Proposal
camle-quarkus-core
The main goal of this extension should be to provide the minimum needed to boot a camel based application which runs the routes available form the classpath / cdi container. This extension won't include a way to configure the context using
camel
properties name-space which is moved to the camle-quarkus-main extension.User that need specific component/context configuration can use CDI (we probably need to support the concept of customizer with CDI beans).
camle-quarkus-main
camle-quarkus-core
and start itAmong other things, this extension will include the support for the
camel
properties name-space making it more visible because as today, as example, it is not clear what you can do if you disable main through thequarkus.camel.main
property but you still have thecamel
propertiescamle-quarkus-main-static (name is just purely indicative)
The main goal here is to have a clear separation between default and static mode and have some more freedom to experiment. Eventually it could become the default bootstrap in the future but for the time being I think it could be better to have it in a dedicated extension so it is clear that it is for advanced and concious use.
The text was updated successfully, but these errors were encountered: