170.4. Blobstore の使用例
170.4.1. 例 1: ブロブへの書き込み
この例では、jclouds コンポーネントを使用して blob 内にメッセージを保存する方法を示します。
from("direct:start")
.to("jclouds:blobstore:aws-s3" +
"?operation=PUT" +
"&container=mycontainer" +
"&blobName=myblob");上記の例では、URI パラメーターのいずれかをメッセージのヘッダーでオーバーライドできます。上記の例が xml を使用してルートを定義すると、次のようになります。
<route>
<from uri="direct:start"/>
<to uri="jclouds:blobstore:aws-s3?operation=PUT&container=mycontainer&blobName=myblob"/>
</route>170.4.2. 例 2: ブロブからの取得/読み取り
この例では、jclouds コンポーネントを使用してブロブの内容を読み取る方法を示します。
from("direct:start")
.to("jclouds:blobstore:aws-s3" +
"?operation=GET" +
"&container=mycontainer" +
"&blobName=myblob");上記の例では、URI パラメーターのいずれかをメッセージのヘッダーでオーバーライドできます。上記の例が xml を使用してルートを定義すると、次のようになります。
<route>
<from uri="direct:start"/>
<to uri="jclouds:blobstore:aws-s3?operation=PUT&container=mycontainer&blobName=myblob"/>
</route>170.4.3. 例 3: ブロブの消費
この例では、指定されたコンテナーの下にあるすべてのブロブが消費されます。生成された交換には、ブロブのペイロードが本文として含まれます。
from("jclouds:blobstore:aws-s3" +
"?container=mycontainer")
.to("direct:next");以下に示すように、xml を使用して同じ目標を達成できます。
<route>
<from uri="jclouds:blobstore:aws-s3?operation=GET&container=mycontainer&blobName=myblob"/>
<to uri="direct:next"/>
</route>jclouds:compute:aws-ec2?operation=CamelJcloudsCreateNode&imageId=AMI_XXXXX&locationId=eu-west-1&group=mygroup