Red Hat Camel K is deprecated
Red Hat Camel K is deprecated and the End of Life date for this product is June 30, 2025. For help migrating to the current go-to solution, Red Hat build of Apache Camel, see the Migration Guide.63.3. 使用状況
ここでは、salesforce-update-sink
の使用方法について説明します。
63.3.1. Knative Sink
salesforce-update-sink
Kamelet を Knative オブジェクトにバインドすることで、Knative シンクとして使用することができます。
salesforce-update-sink-binding.yaml
apiVersion: camel.apache.org/v1alpha1 kind: KameletBinding metadata: name: salesforce-update-sink-binding spec: source: ref: kind: Channel apiVersion: messaging.knative.dev/v1 name: mychannel sink: ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: salesforce-update-sink properties: clientId: "The Consumer Key" clientSecret: "The Consumer Secret" password: "The Password" sObjectId: "The Object Id" sObjectName: "Contact" userName: "The Username"
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: salesforce-update-sink-binding
spec:
source:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: salesforce-update-sink
properties:
clientId: "The Consumer Key"
clientSecret: "The Consumer Secret"
password: "The Password"
sObjectId: "The Object Id"
sObjectName: "Contact"
userName: "The Username"
63.3.1.1. 前提条件
接続先の OpenShift クラスターにRed Hat Integration - Camel Kがインストールされていることを確認します。
63.3.1.2. クラスター CLI の使用手順
-
salesforce-update-sink-binding.yaml
ファイルをローカルドライブに保存してから、設定に合わせて編集します。 以下のコマンドを使用してシンクを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f salesforce-update-sink-binding.yaml
oc apply -f salesforce-update-sink-binding.yaml
63.3.1.3. Kamel CLI を使用するための手順
以下のコマンドを使用してシンクを設定し、実行します。
kamel bind channel:mychannel salesforce-update-sink -p "sink.clientId=The Consumer Key" -p "sink.clientSecret=The Consumer Secret" -p "sink.password=The Password" -p "sink.sObjectId=The Object Id" -p "sink.sObjectName=Contact" -p "sink.userName=The Username"
kamel bind channel:mychannel salesforce-update-sink -p "sink.clientId=The Consumer Key" -p "sink.clientSecret=The Consumer Secret" -p "sink.password=The Password" -p "sink.sObjectId=The Object Id" -p "sink.sObjectName=Contact" -p "sink.userName=The Username"
このコマンドは、クラスターの現在の namespace に KameletBinding を作成します。
63.3.2. Kafka Sink
salesforce-update-sink
Kamelet を Kafka トピックにバインドすることで、Kafka シンクとして使用することが可能です。
salesforce-update-sink-binding.yaml
apiVersion: camel.apache.org/v1alpha1 kind: KameletBinding metadata: name: salesforce-update-sink-binding spec: source: ref: kind: KafkaTopic apiVersion: kafka.strimzi.io/v1beta1 name: my-topic sink: ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: salesforce-update-sink properties: clientId: "The Consumer Key" clientSecret: "The Consumer Secret" password: "The Password" sObjectId: "The Object Id" sObjectName: "Contact" userName: "The Username"
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: salesforce-update-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: salesforce-update-sink
properties:
clientId: "The Consumer Key"
clientSecret: "The Consumer Secret"
password: "The Password"
sObjectId: "The Object Id"
sObjectName: "Contact"
userName: "The Username"
63.3.2.1. 前提条件
AMQ Streams Operator を OpenShift クラスターにインストールし、現在の namespace に my-topic
という名前のトピックを作成していることを確認します。接続先の OpenShift クラスターにRed Hat Integration - Camel Kがインストールされていることを確認します。
63.3.2.2. クラスター CLI の使用手順
-
salesforce-update-sink-binding.yaml
ファイルをローカルドライブに保存してから、設定に合わせて編集します。 以下のコマンドを使用してシンクを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f salesforce-update-sink-binding.yaml
oc apply -f salesforce-update-sink-binding.yaml
63.3.2.3. Kamel CLI を使用するための手順
以下のコマンドを使用してシンクを設定し、実行します。
kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic salesforce-update-sink -p "sink.clientId=The Consumer Key" -p "sink.clientSecret=The Consumer Secret" -p "sink.password=The Password" -p "sink.sObjectId=The Object Id" -p "sink.sObjectName=Contact" -p "sink.userName=The Username"
kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic salesforce-update-sink -p "sink.clientId=The Consumer Key" -p "sink.clientSecret=The Consumer Secret" -p "sink.password=The Password" -p "sink.sObjectId=The Object Id" -p "sink.sObjectName=Contact" -p "sink.userName=The Username"
このコマンドは、クラスターの現在の namespace に KameletBinding を作成します。