Code of properties in Apache Camel



  • There is a need to use Russian symbols in .properties. According to Camel documentation, the attributes in ISO-8859-1 are calculated. Is there any way to change this code to UTF-8?

    I use Camel in a Blueprint connection:

    <?xml version="1.0" encoding="UTF-8"?>
    

    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"
    xsi:schemaLocation="
    http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
    http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
    http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0 ">

    &lt;ext:property-placeholder id="limit-processor"&gt;
        &lt;ext:default-properties&gt;
            &lt;ext:property name="encoding" value="UTF-8"/&gt;
        &lt;/ext:default-properties&gt;
        &lt;ext:location&gt;file:etc/ActiveMQConnection.properties&lt;/ext:location&gt;
        &lt;ext:location&gt;file:etc/automation/somth.properties&lt;/ext:location&gt;
    &lt;/ext:property-placeholder&gt;
    

    The method described above does not work



  • Got a solution.
    In ext:property-placeholder, there is no encoding atribut, so it always counts as default in ISO-8859-1.
    You should have removed the properties of the Cyrillic and transferred to Camel'ov propertyPlaceholder:

     <ext:property-placeholder id="limit-processor">
    <ext:location>file:etc/ActiveMQConnection.properties</ext:location>
    </ext:property-placeholder>

    <camelContext id="proc_tvh_limit" xmlns="http://camel.apache.org/schema/blueprint" messageHistory="true">
    <propertyPlaceholder id="properties" location="file:etc/automation/somth.properties" encoding="UTF-8"/>
    <!-- route -->
    <routeBuilder ref="Router"/>

    &lt;/camelContext&gt;
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2