43.3. 用途
ここでは、protobuf-deserialize-actionの使用方法について説明します。
43.3.1. Knative Action リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
protobuf-deserialize-action Kamelet を Knative バインディングの中間ステップとして使用できます。
protobuf-deserialize-action-binding.yaml
43.3.1.1. 前提条件 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
接続先のOpenShiftクラスタに「Red Hat Integration - Camel K」がインストールされていることを確認します。
43.3.1.2. クラスター CLI の使用手順 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
-
protobuf-deserialize-action-binding.yamlファイルをローカルドライブに保存し、必要に応じて編集します。 以下のコマンドを使用して、アクションを実行します。
oc apply -f protobuf-deserialize-action-binding.yaml
oc apply -f protobuf-deserialize-action-binding.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
43.3.1.3. Kamel CLI を使用するための手順 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のコマンドを使用して、アクションを設定および実行します。
kamel bind "timer-source?message={\"first\":\"Ada\",\"last\":\"Lovelace\"}" --step json-deserialize-action --step protobuf-serialize-action -p "step-1.schema=message Person { required string first = 1; required string last = 2; }" --step protobuf-deserialize-action -p "step-2.schema=message Person { required string first = 1; required string last = 2; }" --step json-serialize-action channel:mychannel
kamel bind "timer-source?message={\"first\":\"Ada\",\"last\":\"Lovelace\"}" --step json-deserialize-action --step protobuf-serialize-action -p "step-1.schema=message Person { required string first = 1; required string last = 2; }" --step protobuf-deserialize-action -p "step-2.schema=message Person { required string first = 1; required string last = 2; }" --step json-serialize-action channel:mychannel
このコマンドは、クラスターの現在の namespace に KameletBinding を作成します。