33.4. JSLT に値を渡す
Camel は、本体に JSLT 式を適用するときに、交換情報を変数として提供できます。Exchange から使用できる変数は次のとおりです。
| name | value |
|---|---|
| ヘッダー |
json オブジェクトとしての |
| exchange.properties |
json オブジェクトとしての Exchange プロパティー。 |
Jackson で json に変換できない値はすべて拒否され、jslt 式では使用できません。
たとえば、"type" という名前のヘッダーと交換プロパティー "instance" には、次のようにアクセスできます。
{
"type": $headers.type,
"instance": $exchange.properties.instance
}
{
"type": $headers.type,
"instance": $exchange.properties.instance
}