You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2023/09/19 09:10:13 UTC

[GitHub] [camel] davsclaus opened a new pull request, #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

davsclaus opened a new pull request, #11457:
URL: https://github.com/apache/camel/pull/11457

   …n define beans that can be used for advanced global configuration on camel context which the legacy spring/blueprint XML DSL can do.
   
   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I have run `mvn clean install -DskipTests` locally and I have committed all auto-generated changes
   
   <!--
   You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1726230252

   Yeah I have a better PR in the works, so will close this - I just need to copy over some of the unit tests as we should have them for the new PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] grgrzybek commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "grgrzybek (via GitHub)" <gi...@apache.org>.
grgrzybek commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725258312

   See my comment under https://issues.apache.org/jira/browse/CAMEL-19846 ;)
   Camel changes very fast, so I'd have to catch up a bit again. But when I was preparing https://github.com/apache/camel-kamelets-examples/blob/main/jbang/app-routes-spring-beans/app.xml, it worked ;)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725405269

   Ah yes that is another possibility to move the "beans" parsing out of the regular phase, and make it part of preParse only with some special code in the route builder, ala we do for camel-k stuff.
   
   Then the beans are eager and would be set during bootstrap


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus closed pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus closed pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…
URL: https://github.com/apache/camel/pull/11457


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725120435

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :robot: CI automation will test this PR automatically.
   
   :camel: Apache Camel Committers, please review the following items:
   
   * First-time contributors **require MANUAL approval** for the GitHub Actions to run
   
   * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   * You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
   
   * Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary. 
   
   * :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725259262

   > @davsclaus so what I learned from @grgrzybek is that this is already supported by:
   > 
   > 1. Register beans before DefaultConfigurationConfigurer searches
   >    https://github.com/apache/camel/blob/main/dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java#L83-L102
   > 2. DefaultConfigurationConfigurer search in bean registry, if CamelContext related bean is found, use them
   >    https://github.com/apache/camel/blob/main/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java#L894
   > 
   > It's already working for XML IO https://github.com/apache/camel-kamelets-examples/blob/main/jbang/app-routes-spring-beans/app.xml#L20-L22
   > 
   
   This is only when using spring-beans (eg real spring dependency injection). If you just have 100% camel xml files (routes and beans) then spring is NOT used at all, and this PR would be needed to have beans working for that - just like in YAML DSL.
   
   > So once YamlRoutesBuilderLoader#preParseRoute() supports loading beans into bean registry, this should work for YAML DSL as well.
   > 
   > @grgrzybek could you chime in if there's something to add?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] igarashitm commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "igarashitm (via GitHub)" <gi...@apache.org>.
igarashitm commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725248206

   @davsclaus so what I learned from @grgrzybek is that this is already supported by:
   
   1. Register beans before DefaultConfigurationConfigurer searches
   https://github.com/apache/camel/blob/main/dsl/camel-xml-io-dsl/src/main/java/org/apache/camel/dsl/xml/io/XmlRoutesBuilderLoader.java#L83-L102
   
   3. DefaultConfigurationConfigurer search in bean registry, if CamelContext related bean is found, use them 
   https://github.com/apache/camel/blob/main/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java#L894
   
   It's already working for XML IO
    https://github.com/apache/camel-kamelets-examples/blob/main/jbang/app-routes-spring-beans/app.xml#L20-L22
   
   So once YamlRoutesBuilderLoader#preParseRoute() supports loading beans into bean registry, this should work for YAML DSL as well.
   
   @grgrzybek could you chime in if there's something to add?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] igarashitm commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "igarashitm (via GitHub)" <gi...@apache.org>.
igarashitm commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725279489

   It's not the spring injection, XmlRoutesBuilderLoader.preParseRoute() parses beans and register them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] igarashitm commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "igarashitm (via GitHub)" <gi...@apache.org>.
igarashitm commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1725275411

   I also looked at it with debugger on main branch and the preParseRoute() is still invoked before DefaultConfigurationConfigurer.afterConfigure(), so for me it looks @grgrzybek 's work is still valid.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #11457: CAMEL-19846: yaml and xml DSL - Add support for BeanLoader so they ca…

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #11457:
URL: https://github.com/apache/camel/pull/11457#issuecomment-1726340022

   Replaced by https://github.com/apache/camel/pull/11476


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org