2.3. 使用方法
ここでは、avro-deserialize-action
の使用方法について説明します。
2.3.1. Knative Action リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
avro-deserialize-action
Kamelet を Knative バインディングの中間ステップとして使用することができます。
avro-deserialize-action-binding.yaml
2.3.1.1. 前提条件 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
接続先の OpenShift クラスターにRed Hat Integration - Camel Kがインストールされていることを確認します。
2.3.1.2. クラスター CLI の使用手順 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
-
avro-deserialize-action-binding.yaml
ファイルをローカルドライブに保存し、設定に合わせて編集します。 以下のコマンドを使用して、アクションを実行します。
oc apply -f avro-deserialize-action-binding.yaml
oc apply -f avro-deserialize-action-binding.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3.1.3. Kamel CLI を使用するための手順 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のコマンドを使用して、アクションを設定および実行します。
kamel bind --name avro-deserialize-action-binding timer-source?message='{"first":"Ada","last":"Lovelace"}' --step json-deserialize-action --step avro-serialize-action -p step-1.schema='{"type": "record", "namespace": "com.example", "name": "FullName", "fields": [{"name": "first", "type": "string"},{"name": "last", "type": "string"}]}' --step avro-deserialize-action -p step-2.schema='{"type": "record", "namespace": "com.example", "name": "FullName", "fields": [{"name": "first", "type": "string"},{"name": "last", "type": "string"}]}' --step json-serialize-action channel:mychannel
kamel bind --name avro-deserialize-action-binding timer-source?message='{"first":"Ada","last":"Lovelace"}' --step json-deserialize-action --step avro-serialize-action -p step-1.schema='{"type": "record", "namespace": "com.example", "name": "FullName", "fields": [{"name": "first", "type": "string"},{"name": "last", "type": "string"}]}' --step avro-deserialize-action -p step-2.schema='{"type": "record", "namespace": "com.example", "name": "FullName", "fields": [{"name": "first", "type": "string"},{"name": "last", "type": "string"}]}' --step json-serialize-action channel:mychannel
このコマンドは、クラスターの現在の namespace に KameletBinding を作成します。