Beena Rautela
Beena Rautela

Reputation: 53

Inside a Camel Processor, variable declared to hold property from camel property place holder is not working

I have a property PFlow_XXXX="some value" defined which is read using camel property placeholder. Inside the processor, the property value is constructed by extracting the xxx value from file name.Now when I try to get the value of this property inside the processor like this

exchange.getContext().resolvePropertyPlaceholders("{{xsdPathVar}}"));

where String xsdPathVar = "PFlow_"+extracting from file.

But this is not working. Can some one help me how to read the property value from a string variable.

Upvotes: 0

Views: 501

Answers (1)

Erik Karlstrand
Erik Karlstrand

Reputation: 1537

When using propertyPlaceholder you can inject your properties in beans by using the @PropertyInjectannotation:

@PropertyInject(value = "xsdPathVar")
String xsdPathVar;

Public class MyProcessor implements Processor {
    ...
}

I'm not entirely sure if this is what you're asking for?

Upvotes: 1

Related Questions