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.40.3. 使用方法
このセクションでは、jms-ibm-mq-source
の使用方法について説明します。
40.3.1. Knative ソース
jms-ibm-mq-source
Kamelet を Knative オブジェクトにバインドすることで、Knative ソースとして使用することができます。
jms-ibm-mq-source-binding.yaml
apiVersion: camel.apache.org/v1alpha1 kind: KameletBinding metadata: name: jms-ibm-mq-source-binding spec: source: ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: jms-ibm-mq-source properties: serverName: "10.103.41.245" serverPort: "1414" destinationType: "queue" destinationName: "DEV.QUEUE.1" queueManager: QM1 channel: DEV.APP.SVRCONN username: app password: passw0rd sink: ref: kind: Channel apiVersion: messaging.knative.dev/v1 name: mychannel
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: jms-ibm-mq-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: jms-ibm-mq-source
properties:
serverName: "10.103.41.245"
serverPort: "1414"
destinationType: "queue"
destinationName: "DEV.QUEUE.1"
queueManager: QM1
channel: DEV.APP.SVRCONN
username: app
password: passw0rd
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
40.3.1.1. 前提条件
接続先の OpenShift クラスターにRed Hat Integration - Camel Kがインストールされていることを確認します。
40.3.1.2. クラスター CLI の使用手順
-
jms-ibm-mq-source-binding.yaml
ファイルをローカルドライブに保存し、設定に合わせてこれを編集します。 以下のコマンドを使用してソースを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f jms-ibm-mq-source-binding.yaml
oc apply -f jms-ibm-mq-source-binding.yaml
40.3.1.3. Kamel CLI を使用するための手順
以下のコマンドを使用してソースを設定および実行します。
kamel bind --name jms-ibm-mq-source-binding 'jms-ibm-mq-source?serverName=10.103.41.245&serverPort=1414&destinationType=queue&destinationName=DEV.QUEUE.1&queueManager=QM1&channel=DEV.APP.SVRCONN&username=app&password=passw0rd' channel:mychannel
kamel bind --name jms-ibm-mq-source-binding 'jms-ibm-mq-source?serverName=10.103.41.245&serverPort=1414&destinationType=queue&destinationName=DEV.QUEUE.1&queueManager=QM1&channel=DEV.APP.SVRCONN&username=app&password=passw0rd' channel:mychannel
このコマンドは、クラスターの現在の namespace に KameletBinding を作成します。