Fuse Camel: Overriding Blueprint properties in Camel unit tests

Solution Unverified - Updated -

Issue

  • How do you externalize configuration parameters ?
  • With JBoss Fuse how do you externalize configuration parameters such as file paths, queue names, url, etc so that they are not hard coded in your camel routes, beans, and custom components?
  • How can a blueprint property place holder be overridden in a unit test that extends CamelBlueprintTestSupport.
  • The useOverridePropertiesWithPropertiesComponent() is only for overriding camel context placeholder values i.e. a placeholder defined within a camel route.

If the placeholder appears outside the camel route (e.g. in a bean definition, as shown below) how can a property be specified for the test run?

<cm:property-placeholder persistent-id="com.redhat.support">
    <cm:default-properties>
      <cm:property name="brokerUrl" value="tcp://myhost:61616" />      
    </cm:default-properties>
  </cm:property-placeholder>

  <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="${brokerUrl}" />
  </bean>

  • We are trying to publish messages tothru jms endpoint and the jms destination name is dynamic.
   <to uri="jms:topic:${property.destinationTopic}?username={{JMS_UserName}}&amp;password={{JMS_Password}}" />

The jms end point is not able to resolve the varaible ${property.destinationTopic}..

Could you please explain how can we achive this.

Environment

  • Fuse ESB
    • 7.1
  • Red Hat JBoss Fuse
    • 6.x
  • Red Hat JBoss A-MQ
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content