usman
usman

Reputation: 1391

how can we use apache camel's property component to read properties for plain java?

I know I can use property component to read properties for apache camel specific implementations but do camel also provide some syntax to use same syntax OR fetch properties to use for plain java code For example:

For camel specific code I can use like this :

camelCtx.getEndpoint(Constants.URI+"&partitioner={{partitioner.class}}&serializerClass={{serializer.class}}");

Now how can I use same properties for my plain java code e.g:

Properties props = new Properties();
props.setProperty("metadata.broker.list",{{metadataBrokerList}});

Upvotes: 0

Views: 619

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55760

See the resolovePropertyPlaceholders method on CamelContext which can do this: http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#resolvePropertyPlaceholders(java.lang.String)

Upvotes: 1

Related Questions