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