Properties placeholders on camel-cxf configuration in Blueprint
Issue
I am using property placeholder for a camel route that involves camel-cxf endpoint in blueprint. Some of the CXF bean configuration elements seem not to resolve the property placeholders:
<cm:property-placeholder id="myPlaceHolder" persistent-id="cmProp" placeholder-prefix="{{" placeholder-suffix="}}">
<cm:default-properties>
<cm:property name="propDir" value="/Users/jluo/config" ></cm:property>
<cm:property name="propFile" value="wss4jConfig.properties" ></cm:property>
</cm:default-properties>
</cm:property-placeholder>
<ext:property-placeholder id="ext-placeholder">
<ext:default-properties>
</ext:default-properties>
<ext:location>file:{{propDir}}/{{propFile}}</ext:location>
</ext:property-placeholder>
<camelcxf:cxfEndpoint id="reportIncident"
address="{{connector.input.http.cxf}}"
wsdlURL="META-INF/wsdl/report_incident.wsdl"
serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
endpointName="s:ReportIncidentService"
serviceName="s:ReportIncidentEndpointService"
xmlns:s="http://reportincident.example.camel.apache.org">
<camelcxf:inInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"></bean>
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<property name="properties">
<map>
<entry key="action" value="Signature"></entry>
<entry key="user" value="clientx509v1"></entry>
<entry key="passwordCallbackClass" value="org.apache.camel.example.reportincident.ServerUTPasswordCallback"></entry>
<entry key="signaturePropRefId" value="inSignatureProperties"></entry>
<entry key="inSignatureProperties" value-ref="inCryptoProperties"></entry>
<entry key="signatureKeyIdentifier" value="DirectReference"></entry>
</map>
</property>
</bean>
<bean class="org.apache.cxf.ws.security.wss4j.DefaultCryptoCoverageChecker">
<property name="signBody">
<value type="java.lang.Boolean">true</value>
</property>
</bean>
</camelcxf:inInterceptors>
<camelcxf:outInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"></bean>
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
<property name="properties">
<map>
<entry key="action" value="Signature"></entry>
<entry key="user" value="serverx509v1"></entry>
<entry key="passwordCallbackClass" value="org.apache.camel.example.reportincident.ServerUTPasswordCallback"></entry>
<entry key="signaturePropRefId" value="outSignatureProperties"></entry>
<entry key="outSignatureProperties" value-ref="outCryptoProperties"></entry>>
<entry key="signatureKeyIdentifier" value="DirectReference"></entry>
<entry key="signatureParts" value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body"></entry>
</map>
</property>
</bean>
</camelcxf:outInterceptors>
<camelcxf:properties>
<entry key="dataFormat" value="CXF_MESSAGE"></entry>
</camelcxf:properties>
</camelcxf:cxfEndpoint>
<bean id="inCryptoProperties" class="java.util.Properties">
<argument>
<props>
<prop key="org.apache.ws.security.crypto.provider">org.apache.ws.security.components.crypto.Merlin</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.type">jsk</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.password">storepassword</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.alias">clientx509v1</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.file">{{connector.input.http.cxf.keystore}}</prop>
</props>
</argument>
</bean>
<bean id="outCryptoProperties" class="java.util.Properties">
<argument>
<props>
<prop key="org.apache.ws.security.crypto.provider">org.apache.ws.security.components.crypto.Merlin</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.type">jks</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.password">storepassword</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.alias">serverx509v1</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.file">{{connector.output.http.cxf.keystore}}</prop>
</props>
</argument>
</bean>
<bean id="reporaIncidentProcessor" class="org.apache.camel.example.reportincident.ReportIncidentProcessor"></bean>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="cxf:bean:reportIncident"></from>
<process ref="reporaIncidentProcessor"></process>
</route>
<route>
<from uri="timer://foo?repeatCount=1"></from>
<log message="The property value of connection.input.http.cxf: {{connector.input.http.cxf}}"></log>
</route>
</camelContext>
</blueprint>
The property placeholder
address="{{connector.input.http.cxf}}"
works fine for camel-cxf endpoint while the property placeholders defined in the Properties beans:
<prop key="org.apache.ws.security.crypto.merlin.keystore.file">{{connector.input.http.cxf.keystore}}</prop>
and
<prop key="org.apache.ws.security.crypto.merlin.keystore.file">{{connector.output.http.cxf.keystore}}</prop>
do not work.
Any idea why?
Environment
- Red Hat JBoss Fuse
- 6.x
- Blueprint
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
