275.4. パスと uriTemplate の構文

path および uriTemplate オプションは、パラメーターのサポートを使用して REST コンテキストパスを定義する REST 構文を使用して定義されます。 

ヒント: uriTemplate が設定されていない場合、パスオプションは同じように機能します。パスのみを設定するか、両方のオプションを設定するかは問題ではありません。パスと uriTemplate の両方を設定することは、REST ではより一般的な方法ですが。

以下は、パスのみを使用した Camel ルートです。

from("rest:get:hello")
  .transform().constant("Bye World");

次のルートでは、キー me を持つ Camel ヘッダーにマップされたパラメーターを使用します。

from("rest:get:hello/{me}")
  .transform().simple("Bye ${header.me}");

次の例では、基本パスを hello として設定し、uriTemplates を使用して 2 つの REST サービスを設定しています。

from("rest:get:hello:/{me}")
  .transform().simple("Hi ${header.me}");

from("rest:get:hello:/french/{me}")
  .transform().simple("Bonjour ${header.me}");