Skip to content
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

Support Quarkus command mode #1037

Closed
lburgazzoli opened this issue Apr 6, 2020 · 10 comments · Fixed by #1344
Closed

Support Quarkus command mode #1037

lburgazzoli opened this issue Apr 6, 2020 · 10 comments · Fixed by #1344
Assignees
Milestone

Comments

@lburgazzoli
Copy link
Contributor

lburgazzoli commented Apr 6, 2020

https://github.com/quarkusio/quarkus/blob/master/docs/src/main/asciidoc/command-mode-reference.adoc

camel-main supports giving some arguments from the command line. i.e. hoe many messages to wait before to shut down so it would be nice if we can optionally support Quarkus' command mode

@zhfeng
Copy link
Contributor

zhfeng commented Apr 20, 2020

I can take a look at this issue, please assign it to me.

@zhfeng
Copy link
Contributor

zhfeng commented Apr 22, 2020

I just think if we support the command lines, it could be too late to pass the args to the camel context which could be started when the Quarkus bootstrap up. Or we have to defer the CamelMain.start() to the QuarkusApplication main method ?

@lburgazzoli
Copy link
Contributor Author

I think yes, when camel-main is enabled, then it should be started by the QuarkusApplication main method (like any other cmael-main based runtime)

@lburgazzoli
Copy link
Contributor Author

lburgazzoli commented Apr 22, 2020

I also think we can revisit the way we do bootstrap camel-quarkus (naming is purely indicative):

  • embedded (core)
    • routes are added to the camel context directly
    • context need to be programmatically configured
  • main
    • routes and configuration classes are managed by camel-main
    • support for command line
    • support for configuration through properties
  • static (aka lightweight)
    • routes are added to the camel context directly
    • some limitation may happen
    • context need to be programmatically configured

We can then provide main and static behaviour through extensions so depending of the end user need we may achieve different optimization or behaviours without cluttering the code too much.

/cc @gnodet @davsclaus WDYT ?

@davsclaus
Copy link
Contributor

Oh @lburgazzoli thats a great idea to have different extensions for the different bootstrap modes. And we can also have camel-quarkus to log at INFO level which mode it runs in so the end user can better see this too - and we can also better document explain this and have different examples etc. Instead of some magic option in the application.properties file to switch mode.

@lburgazzoli
Copy link
Contributor Author

We can probably have a default and overrideable assembler in the core extension that does the bare minimum to set-up and run routes on a context so as example running a simple timer -> log example would require only the camel-quarkus-timer extension dependency, but then the assembler is swiped by adding either the main or static bootsrtapper

@zhfeng
Copy link
Contributor

zhfeng commented Apr 22, 2020

So the CamelBootstrapBuildItem might be introduced here to be added in the assembler ? Also I'm not very clear how to control the bootstrap mode by the options in the application,properties. currently the quarkus.camel.main.enabled is used.

@lburgazzoli
Copy link
Contributor Author

lburgazzoli commented Apr 22, 2020

We don't need to control the bootstrap by an option but instead each "boostrap extension" should override the default assembler so quarkus.camel.main.enabled should can go away

@zhfeng
Copy link
Contributor

zhfeng commented Apr 22, 2020

Thanks @lburgazzoli - it looks like a big change to introduce the "bootstrap extension" and I think it could be better to raise a new issue.

@lburgazzoli
Copy link
Contributor Author

yeah I will

@jamesnetherton jamesnetherton added this to the 1.0.0-CR3 milestone Jun 3, 2020
@lburgazzoli lburgazzoli self-assigned this Jun 18, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 18, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 19, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 19, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 19, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 19, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 19, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 19, 2020
lburgazzoli added a commit to lburgazzoli/apache-camel-quarkus that referenced this issue Jun 20, 2020
lburgazzoli added a commit that referenced this issue Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants