Could not create route with property in Fuse 6.2

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Fuse
    • 6.2.0

Issue

I having below in a route and it is throwing exception while starting the camel app.

<setProperty propertyName="FTP_REMOTE_FILENAME">
   <simple>{{REMOTE_DIR}}/${property.REMOTE_FILENAME}</simple>
</setProperty>

It fails with exception:

Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route Ftp at: >>> SetProperty[FTP_REMOTE_FILENAME, simple{{{REMOTE_DIR}}/${property.REMOTE_FILENAME}}] <<< in route: Route(Ftp)[[From[direct:Ftp]] -> [OnException[[class c... because of Could not resolve placeholder 'property.REMOTE_FILENAME' in string value "/com/sample/${property.REMOTE_FILENAME}"
    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)

Resolution

Try with below tag for property substitution:

<setProperty propertyName="FTP_REMOTE_FILENAME">
    <simple>{{REMOTE_DIR}}/$simple{property.REMOTE_FILENAME}</simple>
</setProperty>

For more detail,take a look at section "Clashing Spring property placeholders with Camels Simple language" from camel wiki page.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.