250.17.2. プレースホルダー構文
Camel ルートのプレースホルダー {{ および }}
に Camel 構文 を
使用すると、OSGi Blueprint から値を検索する方法に注目してください。
プレースホルダーの Blueprint 構文は ${ }
です。そのため、< camelContext>
以外では ${ }
構文を使用する必要があります。ここで、< camelContext
> 内では {{ および }}
構文 を
使用する必要があります。
OSGi Blueprint を使用すると構文の設定が可能になり、必要に応じてそれらを実際に合わせることができます。
また、ID により、特定の OSGi Blueprint プロパティープレースホルダーを明示的に参照することもできます。以下の例のように、Camel の < propertyPlaceholder>
を使用する必要があります。
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> <!-- OSGI blueprint property placeholder --> <cm:property-placeholder id="myblueprint.placeholder" persistent-id="camel.blueprint"> <!-- list some properties as needed --> <cm:default-properties> <cm:property name="prefix.result" value="mock:result"/> </cm:default-properties> </cm:property-placeholder> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <!-- using Camel properties component and refer to the blueprint property placeholder by its id --> <propertyPlaceholder id="properties" location="blueprint:myblueprint.placeholder" prefixToken="[[" suffixToken="]]" propertyPrefix="prefix."/> <!-- in the route we can use {{ }} placeholders which will lookup in blueprint --> <route> <from uri="direct:start"/> <to uri="mock:foo"/> <to uri="[[result]]"/> </route> </camelContext> </blueprint>