Chapter 42. JMS - IBM MQ Source
A Kamelet that can read events from an IBM MQ message queue using JMS.
In your Pipe file, you must explicitly declare the IBM MQ Server driver dependency in spec→integration→dependencies:
spec:
...
integration:
...
dependencies:
- "mvn:com.ibm.mq:com.ibm.mq.jakarta.client:<version>"
42.1. Configuration Options Copy linkLink copied to clipboard!
The following table summarizes the configuration options available for the jms-ibm-mq-source Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
| channel * | IBM MQ Channel | Name of the IBM MQ Channel. | string | ||
| destinationName * | Destination Name | The destination name. | string | ||
| password * | Password | Password to authenticate to IBM MQ server. | string | ||
| queueManager * | IBM MQ Queue Manager | Name of the IBM MQ Queue Manager. | string | ||
| serverName * | IBM MQ Server name | IBM MQ Server name or address. | string | ||
| serverPort * | IBM MQ Server Port | IBM MQ Server port. | integer | 1414 | |
| username * | Username | Username to authenticate to IBM MQ server. | string | ||
| clientId | IBM MQ Client ID | Name of the IBM MQ Client ID. | string | ||
| destinationType | Destination Type | The JMS destination type (queue or topic). | string | queue | |
| sslCipherSuite | CipherSuite | CipherSuite to use for enabling TLS. | string |
* = Fields marked with an asterisk are mandatory.
42.2. Dependencies Copy linkLink copied to clipboard!
42.2.1. Quarkus dependencies Copy linkLink copied to clipboard!
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifact>camel-quarkus-jms</artifact>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifact>camel-quarkus-kamelet</artifact>
</dependency>
<dependency>
<groupId>org.apache.camel.kamelets</groupId>
<artifact>camel-kamelets-utils</artifact>
<version>4.8.5</version>
</dependency>
</dependencies>
42.3. Usage Copy linkLink copied to clipboard!
42.3.1. Camel JBang usage Copy linkLink copied to clipboard!
42.3.1.1. Prerequisites for JBang Copy linkLink copied to clipboard!
- Install JBang.
You have executed the following command:
jbang app install camel@apache/camel
42.3.1.2. Running a route with JBang Copy linkLink copied to clipboard!
Suppose you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command.
camel run route.yaml
42.3.2. Knative Source Copy linkLink copied to clipboard!
You can use the jms-ibm-mq-source Kamelet as a Knative source by binding it to a Knative object.
jms-ibm-mq-source-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: jms-ibm-mq-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
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
42.3.3. Kafka Source Copy linkLink copied to clipboard!
You can use the jms-ibm-mq-source Kamelet as a Kafka source by binding it to a Kafka topic.
jms-ibm-mq-source-binding.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
name: jms-ibm-mq-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1
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: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic