How to set empty String to the camel property

Solution Verified - Updated -

Issue

Trying to set empty String, but Camel treat it as null.

<route>
    <from uri="timer:xml?repeatCount=1"/>
    <setProperty name="sample">
         <constant></constant>
    </setProperty>
    <log message="${exchangeProperty.sample}"/>
</route>
2025-08-08 15:53:19.505  INFO 23649 --- [5 - timer://xml] hello.xml:17                             : null

Environment

  • Red Hat Build of Apache Camel
    • 4.10

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