Pallavi.G.S
Pallavi.G.S

Reputation: 1

Camel beanio mapping file outside the war

I'm using camel beanio component to marshal and unmarshal the data inside the file.

<beanio id="myBeanio" mapping="classpath:beanio-mapping-file-config.xml"
            streamName="myStreamName" />

It is working fine in tomcat but not working in jboss. So I need to keep the beanio mapping xml outside the war file. By mentioning actual path of mapping xml file for mapping attribute, it is working fine. But I need to get the beanio mapping xml path from environment variable or from properties file. So with below changes,

<beanio id="myBeanio" mapping="file:${env:env_var_name}/beanio-mapping-file-config.xml"
            streamName="myStreamName" />

or

<beanio id="myBeanio" mapping="file:{{prop_name}}/beanio-mapping-file-config.xml"
            streamName="myStreamName" />

I'm getting org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException

The environment variable/property is not getting replaced with the actual value. Camel version used is 2.12.1

How do I solve this problem?

Upvotes: 0

Views: 388

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55555

This i not possible today. You cannot refer to ENV in the mapping field in beanio.

That would require an ENH which I have logged: https://issues.apache.org/jira/browse/CAMEL-9540

Upvotes: 1

Related Questions