[ 
https://issues.apache.org/jira/browse/CAMEL-13243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16774131#comment-16774131
 ] 

Kamesh Sampath commented on CAMEL-13243:
----------------------------------------

Yes, for camel-k cases it would be really nice to have the main method 
automatically set default `application.properties` from classpath to make it 
easier for application to lookup the properties and avoid boilerplate like the 
following in the routes.

```

PropertiesComponent pc = (PropertiesComponent) 
getContext().getComponent("properties");
pc.setLocation("application.properties");

```

and 

```

private static String property(PropertiesComponent propertiesComponent, String 
key, String defaultValue) {
 try {
 if (System.getenv().containsKey(key)
 && System.getenv().get(key) != null) {
 return System.getenv().get(key);
 } else {
 return propertiesComponent.parseUri(propertiesComponent.getPrefixToken() + key 
+ propertiesComponent.getSuffixToken());
 }
 } catch (IllegalArgumentException e) {
 return defaultValue;
 } catch (Exception e) {
 throw new RuntimeException(e);
 }
}

```

> Camel Main - Make it have more functionality and convention out of the box
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-13243
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13243
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 3.0.0
>
>
> For users that just want a plain Camel standalone, and also for Camel K where 
> running low-footprint is important.
> For example to make properties component automatic load from 
> application.properties from root classpath. And also allow to have those 
> properties fallback to lookup via ENV variables, so containers can customize 
> them that way too.
> And add other ideas here to this ticket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to