IBM MQ Source Connector for Confluent Cloud

The fully-managed Kafka Connect IBM MQ Source connector reads messages from an IBM MQ cluster and then writes them to an Apache Kafka® topic.

Features

The IBM MQ Source connector provides the following features:

  • At least once delivery: The connector guarantees that records are delivered at least once to the Kafka topic.
  • Multiple tasks: The connector supports multiple tasks. More tasks may improve performance.
  • JMS message types: The connector supports TextMessage and BytesMessage. It does not support ObjectMessage or StreamMesssage.

For more information, see the Confluent Cloud connector limitations.

For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.

Errors and retry attempts

The IBM MQ Source connector uses the general retry policy implemented for most Kafka Connect connectors. Additionally, the IBM MQ Source connector uses exponential backoff after each retry attempt. The backoff time is the time between retries and a random value between zero and the exponentially increasing bound. The exponential bound is capped at one minute and the initial backoff time is set to 100 milliseconds (ms).

initialbackoffTime * 2 ^ (retry-1)

The following errors will trigger a retry. With the exception of MQRC_GET_INHIBITED, all of the listed errors first shut down the connection and then reconnect before retrying.

  • MQRC_GET_INHIBITED
  • MQRC_BACKED_OUT
  • MQRC_CHANNEL_NOT_AVAILABLE
  • MQRC_CONNECTION_BROKEN
  • MQRC_HOST_NOT_AVAILABLE
  • MQRC_NOT_AUTHORIZED
  • MQRC_Q_MGR_NOT_AVAILABLE
  • MQRC_Q_MGR_QUIESCING
  • MQRC_Q_MGR_STOPPING
  • MQRC_UNEXPECTED_ERROR

Quick Start

Use this quick start to get up and running with the Confluent Cloud IBM MQ source connector. The quick start shows how to attach the connector to an IBM MQ broker, subscribe to the specified queue or topic, and stream data into Apache Kafka®.

Prerequisites
  • Kafka cluster credentials. The following lists the different ways you can provide credentials.
    • Enter an existing service account resource ID.
    • Create a Confluent Cloud service account for the connector. Make sure to review the ACL entries required in the service account documentation. Some connectors have specific ACL requirements.
    • Create a Confluent Cloud API key and secret. To create a key and secret, you can use confluent api-key create or you can autogenerate the API key and secret directly in the Cloud Console when setting up the connector.

Using the Confluent Cloud Console

Step 1: Launch your Confluent Cloud cluster.

See the Quick Start for Apache Kafka using Confluent Cloud for installation instructions.

Step 2: Add a connector.

In the left navigation menu, click Data integration, and then click Connectors. If you already have connectors in your cluster, click + Add connector.

Step 3: Select your connector.

Click the IBM MQ Source connector icon.

IBM MQ Source Connector Icon

Step 4: Set up the connection.

Complete the following and click Continue. The steps show how to set up the connector to run with the required properties. See the IBM MQ Source configuration properties for required and optional property values and definitions.

Note

  • Make sure you have all your prerequisites completed.
  • An asterisk ( * ) designates a required entry.
  1. Enter a connector name.
  2. Select the way you want to provide Kafka Cluster credentials. You can either select a service account resource ID or you can enter an API key and secret (or generate these in the Cloud Console).
  3. Enter the Kafka topic name (or topic names) where you want data sent.
  4. Select the Output Kafka record value format. Schema Registry must be enabled to use a Schema Registry-based format.
  5. Add the IBM MQ Session Destination Name. This is the name of the JMS destination (queue or topic) to read from.
  6. Add the IBM MQ Connection details:
    • Username: Authorized user for the broker host. A Password is required if not using additional connection security.
    • IBM MQ broker host: The hostname for the IBM MQ broker server.
    • Queue Manager: The IBM MQ queue manager.
    • Channel: The communication channel name.
  7. Enter the number of tasks for the connector. The connector supports multiple tasks. More tasks may improve performance.
  8. Transforms and Predicates: See the Single Message Transforms (SMT) documentation for details about adding SMTs.

See the IBM MQ Source configuration properties for required and optional property values and definitions.

Step 5: Launch the connector.

Verify the connection details by previewing the running configuration. Once you’ve validated that the properties are configured to your satisfaction, click Launch.

Tip

For information about previewing your connector output, see Connector Data Previews.

Step 6: Check the connector status.

The status for the connector should go from Provisioning to Running. It may take a few minutes.

Step 7: Check the Kafka topic.

After the connector is running, verify that messages are populating your Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.

See also

For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.

../_images/topology.png

Using the Confluent CLI

Complete the following steps to set up and run the connector using the Confluent CLI.

Note

  • Make sure you have all your prerequisites completed.
  • The example commands use Confluent CLI version 2. For more information see, Confluent CLI v2.

Step 1: List the available connectors.

Enter the following command to list available connectors:

confluent connect plugin list

Step 2: Show the required connector configuration properties.

Enter the following command to show the required connector properties:

confluent connect plugin describe <connector-catalog-name>

For example:

confluent connect plugin describe IbmMQSource

Example output:

The following are required configs:
connector.class : IbmMQSource
name
kafka.api.key
kafka.api.secret
kafka.topic
output.data.format
jms.destination.name
mq.username
mq.hostname
mq.queue.manager
tasks.max

Step 3: Create the connector configuration file.

Create a JSON file that contains the connector configuration properties. The following example shows the required connector properties.

{
  "connector.class": " IbmMQSource",
  "name": "IbmMQSource",
  "kafka.auth.mode": "KAFKA_API_KEY",
  "kafka.api.key": "<my-kafka-api-key>",
  "kafka.api.secret": "<my-kafka-api-secret>",
  "kafka.topic" : "data_topic_0",
  "output.data.format": "AVRO",
  "jms.destination.name": "<destination-name>",
  "mq.username": "<authorized-user>",
  "mq.password": "<user-password>"
  "mq.hostname": "<server-hostname>",
  "mq.queue.manager": <queue-name>",
  "tasks.max" : "1"
}

Note the following property definitions:

  • "name": Sets a name for your new connector.
  • "connector.class": Identifies the connector plugin name.
  • "kafka.auth.mode": Identifies the connector authentication mode you want to use. There are two options: SERVICE_ACCOUNT or KAFKA_API_KEY (the default). To use an API key and secret, specify the configuration properties kafka.api.key and kafka.api.secret, as shown in the example configuration (above). To use a service account, specify the Resource ID in the property kafka.service.account.id=<service-account-resource-ID>. To list the available service account resource IDs, use the following command:

    confluent iam service-account list
    

    For example:

    confluent iam service-account list
    
       Id     | Resource ID |       Name        |    Description
    +---------+-------------+-------------------+-------------------
       123456 | sa-l1r23m   | sa-1              | Service account 1
       789101 | sa-l4d56p   | sa-2              | Service account 2
    
  • "kafka.topic": The Kafka topic name (or comma-separated topic names) where you want data sent.

  • "output.data.format": Supports AVRO, JSON, JSON_SR, and PROTOBUF. Schema Registry must be enabled to use a Schema Registry-based format.

  • "jms.destination.name": This is the name of the JMS destination (queue or topic) to read from.

  • "mq.username": Authorized user for the broker host. mq.password is required if not using additional connection security.

  • "mq.queue.manager": The IBM MQ queue manager.

  • "tasks.max": Enter the number of tasks in use by the connector. The connector supports multiple tasks. More tasks may improve performance.

Single Message Transforms: See the Single Message Transforms (SMT) documentation for details about adding SMTs. See Unsupported transformations for a list of SMTs that are not supported with this connector.

See the IBM MQ Source configuration properties for additional property values and definitions.

Step 4: Load the properties file and create the connector.

Enter the following command to load the configuration and start the connector:

confluent connect create --config <file-name>.json

For example:

confluent connect create --config ibmmq-source.json

Example output:

Created connector  IbmMQSource_0 lcc-ix4dl

Step 5: Check the connector status.

Enter the following command to check the connector status:

confluent connect plugin list

Example output:

ID          |    Name           | Status  |  Type
+-----------+-------------------+---------+-------+
lcc-ix4dl   |  IbmMQSource_0    | RUNNING | source

Step 6: Check the results on the broker.

After the connector is running, verify that messages are populating your Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.

Configuration Properties

The following connector configuration properties can be used with the IBM MQ Source connector for Confluent Cloud.

mq.username

The username to use when connecting to IBM MQ.

  • Type: String
  • Importance: High
mq.password

The password to use when connecting to IBM MQ.

  • Type: Password
  • Importance: High
mq.hostname

IBM MQ broker Host.

  • Type: String
  • Importance: High
mq.port

IBM MQ broker host.

  • Type: Int
  • Importance: High
  • Default value: 1414
mq.transport.type

The type of transport to use when connecting to IBM MQ.

  • Type: String
  • Importance: High
  • Default value: client
  • Valid values: bindings, client, direct_tcpip, direct_http
mq.queue.manager

The name of the queue manager.

  • Type: String
  • Importance: High
mq.channel

The channel for client connections.

  • Type: String
  • Importance: High
mq.ssl.cipher.suite

The CipherSuite for SSL connections.

  • Type: String
  • Importance: High
  • Default value: “”
mq.ssl.fips.required

Whether SSL FIPS is required.

  • Type: Boolean
  • Importance: High
  • Default value: False
mq.ssl.peer.name

Sets a distinguished name (DN) pattern. If you set mq.ssl.cipher.suite, this property ensures that the connector uses the correct queue manager. The connection attempt fails if the distinguished name provided by the queue manager does not match the pattern in this property.

  • Type: String
  • Importance: High
  • Default value: “”
mq.tls.protocol

The TLS protocol version for secure connections to IBM MQ. The default is TLSv1.2, which is sufficient for most use cases. However, the actual set of allowed values depend on the Java Virtual Machine (JVM). Recent JVM versions support TLSv1.3 and TLSv1.2, TLSv1.1 and TLS. Older JVMs may support SSL, SSLv2 and SSLv3. However, even though these older protocols are supported, they are not recommended for production use.

  • Type: String
  • Importance: Medium
  • Default value: TLSv1.2
  • Valid values: TLSv1.3, TLSv1.2, TLS, SSL, SSLv2, SSLv3
mq.tls.keystore.type

The file format of the keystore file. This is required only when using secure TLS communication with IBM MQ. Note that TLS is enabled by default for IBM MQ on Cloud queue managers version 9.2.1 revision 2 (and later).

  • Type: String
  • Importance: Medium
  • Default value: JKS
mq.tls.keystore.location

The binary keystore file. This is required only when using secure TLS communication with IBM MQ. When using this property in the CLI, you must encode the binary keystore file in base64, take the encoded string, add the data:text/plain;base64 prefix, and then specify the entire string as the property entry. For example: "mq.tls.keystore.location" : "data:text/plain;base64,/u3+7QAAAAIAAAACAAAAAQAGY2xpZ...==".

  • Type: Password
  • Importance: High
mq.tls.keystore.password

The password for the keystore file. This is optional and only needed if mq.tls.keystore.location is set.

  • Type: Password
  • Importance: High
mq.tls.key.password

The private key password used for secure TLS communication with IBM MQ.

  • Type: Password
  • Importance: High
mq.tls.truststore.type

The file format of the truststore file. This is required only when using secure TLS communication with IBM MQ. Note that TLS is enabled by default for IBM MQ on Cloud queue managers version 9.2.1 revision 2 (and later).

  • Type: String
  • Importance: Medium
  • Default value: JKS
mq.tls.truststore.location
The binary truststore file. This is required only when using secure TLS communication with IBM MQ. When using this property in the CLI, you must encode the binary truststore file in base64, take the encoded string, add the data:text/plain;base64 prefix, and then specify the entire string as the property entry. For example: "mq.tls.truststore.location" : "data:text/plain;base64,/u3+7QAAAAIAAAACAAAAAQAGY2xpZ...==".
mq.tls.truststore.password

The password for the truststore file. If a password is not set, access to the truststore is still available, but integrity checking is disabled. This is required only when using secure TLS communication with IBM MQ.

  • Type: Password
  • Importance: High
mq.tls.keymanager.algorithm

The algorithm used by the key manager factory for SSL connections. The default value is the key manager factory algorithm configured for the JVM. This is required only when using secure TLS communication with IBM MQ.

  • Type: String
  • Importance: Low
  • Default value: SunX509
mq.tls.trustmanager.algorithm

The algorithm used by the trust manager factory for SSL connections. The default value is the trust manager factory algorithm configured for the JVM. This is required only when using secure TLS communication with IBM MQ.

  • Type: String
  • Importance: Low
  • Default value: PKIX
mq.tls.secure.random.implementation

The SecureRandom PRNG implementation to use for SSL cryptography operations. By default, the connector tries the PKCS11 implementation first. If PKCS11 is not supported, it iterates through the provider and returns the first working implementation. This is required only when using secure TLS communication with IBM MQ.

  • Type: String
  • Importance: Low
jms.destination.name

The name of the JMS destination (queue or topic) to read from.

  • Type: String
  • Importance: High
jms.destination.type

The JMS destination type, which is either queue or topic.

  • Type: String
  • Importance: High
  • Default value: queue
  • Valid values: queue, topic
max.poll.duration

The maximum amount of time each task can build a batch. The batch is closed and sent to Kafka if not enough messages are read during the time allotted. This helps limit connector lag when the JMS destination has lower throughput.

  • Type: Int
  • Importance: Low
character.encoding

The character encoding to use while receiving the message.

  • Type: String
  • Importance: Low
  • Default value: UTF-8
jms.subscription.durable

Whether the connector task subscription or a JMS topic is durable or not. Durable subscriptions require jms.subscription.name to be set.

  • Type: Boolean
  • Importance: Medium
jms.subscription.name

The JMS subscription name. Supported only when jms.subscription.durable = true. Applicable only for JMS topics.

  • Type: String
  • Importance: Medium
jms.message.selector

The JMS message selector applied to messages in the destination.

  • Type: String
  • Importance: High

Next Steps

See also

For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.

../_images/topology.png