[jira] [Commented] (CAMEL-12646) camel-spring-boot - Auto configuration of complex types should be more tooling friendly
[ https://issues.apache.org/jira/browse/CAMEL-12646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16544413#comment-16544413 ] ASF GitHub Bot commented on CAMEL-12646: Github user davsclaus closed the pull request at: https://github.com/apache/camel/pull/2423 > camel-spring-boot - Auto configuration of complex types should be more > tooling friendly > --- > > Key: CAMEL-12646 > URL: https://issues.apache.org/jira/browse/CAMEL-12646 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot-starters, tooling >Reporter: Claus Ibsen >Assignee: Claus Ibsen >Priority: Major > Fix For: 2.23.0 > > Attachments: Screen Shot 2018-07-12 at 17.43.41.png > > > If you have complex types like javax.sql.DataSource and wants to allow to > configure this via spring boot autoconfiguration in application.properties - > then the generated spring boot classes with all the options will use > getter/setter of types javax.sql.DataSource. That seems correct, but the > spring-boot tooling itself (that generates additional json file) will skip > those as it only support primitives and string types. > So we may need to fool, and generate the getter/setter as String type as you > use it for configuring it as a bean reference by id anyway, eg > camel.component.jdbc.data-source = #myDataSource > We can add in the javadoc that the type is javax.sql.DataSource. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12646) camel-spring-boot - Auto configuration of complex types should be more tooling friendly
[ https://issues.apache.org/jira/browse/CAMEL-12646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541845#comment-16541845 ] ASF GitHub Bot commented on CAMEL-12646: GitHub user davsclaus opened a pull request: https://github.com/apache/camel/pull/2423 Camel 12646 - camel-spring-boot - Auto configuration of complex types should be more tooling friendly The camel maven plugin for spring boot auto configuration source code generation now generates complex types as String types so we can use them via spring boot and its tooling, eg they are listed in the spring-configuration-metadata.json file. See ticket: https://issues.apache.org/jira/browse/CAMEL-12646 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/camel camel-12646 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/2423.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2423 commit 4dfc9f30d9002c06ae496cca997a5265e2cab262 Author: Claus Ibsen Date: 2018-07-12T13:24:46Z CAMEL-12464: camel maven plugin for spring-boot auto configuration polished. commit 2b4e3cf5d625f88c0d01a5cc1730954aaec9f7a4 Author: Claus Ibsen Date: 2018-07-12T14:05:47Z CAMEL-12646: The camel maven plugin for spring boot auto configuration source code generation now generates complex types as String types so we can use them via spring boot and its tooling, eg they are listed in the spring-configuration-metadata.json file. commit bd51298fe84ebcdd020ac93a0c8bbf1e581eded6 Author: Claus Ibsen Date: 2018-07-12T14:52:51Z CAMEL-12646: The camel maven plugin for spring boot auto configuration source code generation now generates complex types as String types so we can use them via spring boot and its tooling, eg they are listed in the spring-configuration-metadata.json file. > camel-spring-boot - Auto configuration of complex types should be more > tooling friendly > --- > > Key: CAMEL-12646 > URL: https://issues.apache.org/jira/browse/CAMEL-12646 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot-starters, tooling >Reporter: Claus Ibsen >Assignee: Claus Ibsen >Priority: Major > Fix For: 2.23.0 > > Attachments: Screen Shot 2018-07-12 at 17.43.41.png > > > If you have complex types like javax.sql.DataSource and wants to allow to > configure this via spring boot autoconfiguration in application.properties - > then the generated spring boot classes with all the options will use > getter/setter of types javax.sql.DataSource. That seems correct, but the > spring-boot tooling itself (that generates additional json file) will skip > those as it only support primitives and string types. > So we may need to fool, and generate the getter/setter as String type as you > use it for configuring it as a bean reference by id anyway, eg > camel.component.jdbc.data-source = #myDataSource > We can add in the javadoc that the type is javax.sql.DataSource. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12646) camel-spring-boot - Auto configuration of complex types should be more tooling friendly
[ https://issues.apache.org/jira/browse/CAMEL-12646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541835#comment-16541835 ] Claus Ibsen commented on CAMEL-12646: - The screenshot shows now with the data-source included, and so in the generated file by spring-boot {code:java} "properties": [ { "sourceType": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties", "name": "camel.component.jdbc.customizer.enabled", "type": "java.lang.Boolean" }, { "sourceType": "org.apache.camel.component.jdbc.springboot.JdbcComponentConfiguration", "name": "camel.component.jdbc.data-source", "description": "To use the DataSource instance instead of looking up the data source by\n name from the registry. The option is a javax.sql.DataSource type.", "type": "java.lang.String" }, { "sourceType": "org.apache.camel.component.jdbc.springboot.JdbcComponentConfiguration", "defaultValue": true, "name": "camel.component.jdbc.enabled", "description": "Enable jdbc component", "type": "java.lang.Boolean" }, { "sourceType": "org.apache.camel.component.jdbc.springboot.JdbcComponentConfiguration", "defaultValue": true, "name": "camel.component.jdbc.resolve-property-placeholders", "description": "Whether the component should resolve property placeholders on itself when\n starting. Only properties which are of String type can use property\n placeholders.", "type": "java.lang.Boolean" } ] {code} > camel-spring-boot - Auto configuration of complex types should be more > tooling friendly > --- > > Key: CAMEL-12646 > URL: https://issues.apache.org/jira/browse/CAMEL-12646 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot-starters, tooling >Reporter: Claus Ibsen >Assignee: Claus Ibsen >Priority: Major > Fix For: 2.23.0 > > Attachments: Screen Shot 2018-07-12 at 17.43.41.png > > > If you have complex types like javax.sql.DataSource and wants to allow to > configure this via spring boot autoconfiguration in application.properties - > then the generated spring boot classes with all the options will use > getter/setter of types javax.sql.DataSource. That seems correct, but the > spring-boot tooling itself (that generates additional json file) will skip > those as it only support primitives and string types. > So we may need to fool, and generate the getter/setter as String type as you > use it for configuring it as a bean reference by id anyway, eg > camel.component.jdbc.data-source = #myDataSource > We can add in the javadoc that the type is javax.sql.DataSource. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12646) camel-spring-boot - Auto configuration of complex types should be more tooling friendly
[ https://issues.apache.org/jira/browse/CAMEL-12646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541574#comment-16541574 ] Claus Ibsen commented on CAMEL-12646: - And these are the options in the spring-configuration-metadata.json file {code:java} "properties": [ { "sourceType": "org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon$CustomizerProperties", "name": "camel.component.jdbc.customizer.enabled", "type": "java.lang.Boolean" }, { "sourceType": "org.apache.camel.component.jdbc.springboot.JdbcComponentConfiguration", "defaultValue": true, "name": "camel.component.jdbc.enabled", "description": "Enable jdbc component", "type": "java.lang.Boolean" }, { "sourceType": "org.apache.camel.component.jdbc.springboot.JdbcComponentConfiguration", "defaultValue": true, "name": "camel.component.jdbc.resolve-property-placeholders", "description": "Whether the component should resolve property placeholders on itself when\n starting. Only properties which are of String type can use property\n placeholders.", "type": "java.lang.Boolean" } ] {code} Notice how the dataSource option is missing. > camel-spring-boot - Auto configuration of complex types should be more > tooling friendly > --- > > Key: CAMEL-12646 > URL: https://issues.apache.org/jira/browse/CAMEL-12646 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot-starters, tooling >Reporter: Claus Ibsen >Assignee: Claus Ibsen >Priority: Major > Fix For: 2.23.0 > > > If you have complex types like javax.sql.DataSource and wants to allow to > configure this via spring boot autoconfiguration in application.properties - > then the generated spring boot classes with all the options will use > getter/setter of types javax.sql.DataSource. That seems correct, but the > spring-boot tooling itself (that generates additional json file) will skip > those as it only support primitives and string types. > So we may need to fool, and generate the getter/setter as String type as you > use it for configuring it as a bean reference by id anyway, eg > camel.component.jdbc.data-source = #myDataSource > We can add in the javadoc that the type is javax.sql.DataSource. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CAMEL-12646) camel-spring-boot - Auto configuration of complex types should be more tooling friendly
[ https://issues.apache.org/jira/browse/CAMEL-12646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16541569#comment-16541569 ] Claus Ibsen commented on CAMEL-12646: - This is the generated source code snippet {code:java} @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @ConfigurationProperties(prefix = "camel.component.jdbc") public class JdbcComponentConfiguration extends ComponentConfigurationPropertiesCommon { /** * To use the DataSource instance instead of looking up the data source by * name from the registry. */ private DataSource dataSource; /** * Whether the component should resolve property placeholders on itself when * starting. Only properties which are of String type can use property * placeholders. */ private Boolean resolvePropertyPlaceholders = true; {code} > camel-spring-boot - Auto configuration of complex types should be more > tooling friendly > --- > > Key: CAMEL-12646 > URL: https://issues.apache.org/jira/browse/CAMEL-12646 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot-starters, tooling >Reporter: Claus Ibsen >Assignee: Claus Ibsen >Priority: Major > Fix For: 2.23.0 > > > If you have complex types like javax.sql.DataSource and wants to allow to > configure this via spring boot autoconfiguration in application.properties - > then the generated spring boot classes with all the options will use > getter/setter of types javax.sql.DataSource. That seems correct, but the > spring-boot tooling itself (that generates additional json file) will skip > those as it only support primitives and string types. > So we may need to fool, and generate the getter/setter as String type as you > use it for configuring it as a bean reference by id anyway, eg > camel.component.jdbc.data-source = #myDataSource > We can add in the javadoc that the type is javax.sql.DataSource. -- This message was sent by Atlassian JIRA (v7.6.3#76005)