camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonin Stefanutti (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-9305) PropertiesComponent.isDefaultCreated method only check the absence of defined locations
Date Tue, 10 Nov 2015 11:40:10 GMT
Antonin Stefanutti created CAMEL-9305:
-----------------------------------------

             Summary: PropertiesComponent.isDefaultCreated method only check the absence of
defined locations
                 Key: CAMEL-9305
                 URL: https://issues.apache.org/jira/browse/CAMEL-9305
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.16.0
            Reporter: Antonin Stefanutti
            Priority: Minor
             Fix For: 2.17.0


In some situations, Camel falls back to creating a default {{PropertiesComponent}} and emits
the following log statement when a configuration property resolution fails:
{code}
PropertiesComponent with name properties must be defined in CamelContext to support property
placeholders. Property with key [foo] not found in properties from text: {{foo}}
{code}
The first sentence is logged when the {{PropertiesComponent.isDefaultCreated}} method returns
{{true}} which indicates that Camel has created this component on its own. However, as the
current implementation solely relies on whether a location has been set on the component,
this leads to some situations where that sentence is logged while the end-user has actually
registered a {{PropertiesComponent}} with the name {{properties}}, for example:
{code}
@Produces
@ApplicationScoped
@Named("properties")
PropertiesComponent configuration() {
    Properties properties = new Properties();
    properties.put("foo", "bar");
    PropertiesComponent component = new PropertiesComponent();
    component.setInitialProperties(properties);
    return component;
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message