126.7. Velocity コンテキスト
Camel は Velocity コンテキスト (単なる Map) でエクスチェンジ情報を提供します。Exchange は次のように転送されます。
| key | value |
|---|---|
|
|
|
|
|
|
|
| In メッセージのヘッダー。 |
|
| Camel コンテキストインスタンス。 |
|
| IN メッセージ |
|
| IN メッセージ |
|
| In メッセージボディー |
|
| Out メッセージ (InOut メッセージエクスチェンジパターンのみ)。 |
|
| Out メッセージ (InOut メッセージエクスチェンジパターンのみ)。 |
プロパティー allowTemplateFromHeader=true を設定し、メッセージヘッダー CamelVelocityContext を以下のとおり設定することで、カスタム VelocityContext を自分でセットアップできます。
VelocityContext velocityContext = new VelocityContext(variableMap);
exchange.getIn().setHeader("CamelVelocityContext", velocityContext);