Skip to content

Commit 26178fe

Browse files
committed
feat: Fix ccdt configuration and update docs
Contributes to mhub/qp-planning#1748 Signed-off-by: Katherine Stanley <katheris@uk.ibm.com>
1 parent c734ad0 commit 26178fe

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,30 @@ The configuration options for the Kafka Connect source connector for IBM MQ are
155155
| mq.queue | The name of the source MQ queue | string | | MQ queue name |
156156
| mq.user.name | The user name for authenticating with the queue manager | string | | User name |
157157
| mq.password | The password for authenticating with the queue manager | string | | Password |
158+
| mq.ccdt.url | The URL for the CCDT file containing MQ connection details | string | | URL for obtaining a CCDT file |
158159
| mq.record.builder | The class used to build the Kafka Connect record | string | | Class implementing RecordBuilder |
159160
| mq.message.body.jms | Whether to interpret the message body as a JMS message type | boolean | false | |
160161
| mq.record.builder.key.header | The JMS message header to use as the Kafka record key | string | | JMSMessageID, JMSCorrelationID, JMSCorrelationIDAsBytes |
161162
| mq.ssl.cipher.suite | The name of the cipher suite for TLS (SSL) connection | string | | Blank or valid cipher suite |
162163
| mq.ssl.peer.name | The distinguished name pattern of the TLS (SSL) peer | string | | Blank or DN pattern |
163164
| topic | The name of the target Kafka topic | string | | Topic name |
164165

166+
### Using a CCDT file
167+
Some of the connection details for MQ can be provided in a [CCDT file](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.con.doc/q016730_.htm) by setting `mq.ccdt.url` in the Kafka Connect source connector configuration file. If this is set the following configuration options are no longer required: `mq.connection.name.list`, `mq.channel.name`.
168+
169+
### Externalizing secrets
170+
[KIP 297](https://cwiki.apache.org/confluence/display/KAFKA/KIP-297%3A+Externalizing+Secrets+for+Connect+Configurations) introduced a mechanism to externalize secrets to be used as configuration for Kafka connectors. If using this mechanism the desired config provider must be configured in the Worker configuration file:
171+
172+
```
173+
# Additional properties for the worker configuration to enable use of ConfigProviders
174+
# multiple comma-separated provider types can be specified here
175+
# config.providers=file
176+
# config.providers=file,other-provider
177+
# config.providers.file.class=org.apache.kafka.common.config.provider.FileConfigProvider
178+
# Other ConfigProvider implementations might require parameters passed in to configure() as follows:
179+
# config.providers.other-provider.param.foo=value1
180+
# config.providers.other-provider.param.bar=value2
181+
```
165182

166183
## Support
167184
A commercially supported version of this connector is available for customers with a support entitlement for [IBM Event Streams](https://developer.ibm.com/messaging/event-streams/).

config/mq-source.properties

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mq.queue.manager=
2424
# A list of one or more host(port) entries for connecting to the queue manager. Entries are separated with a comma - required (unless using CCDT)
2525
mq.connection.name.list=
2626

27-
# The name of the server-connection channel - equired (unless using CCDT)
27+
# The name of the server-connection channel - required (unless using CCDT)
2828
mq.channel.name=
2929

3030
# The name of the source MQ queue - required
@@ -36,8 +36,13 @@ mq.queue=
3636
# The password for authenticating with the queue manager - optional
3737
# mq.password=
3838

39+
# Alternatively can use a ConfigProvider for externalising secrets (see README.md for more details)
40+
# Variable references are of the form ${provider:[path:]key} where the path is optional,
41+
# depending on the ConfigProvider implementation.
42+
# mq.password=${file:/var/run/secret.properties:secret-key}
43+
3944
# The CCDT URL to use to establish a connection to the queue manager - optional
40-
# mq.ccd.url=
45+
# mq.ccdt.url=
4146

4247
# The record builders control conversion of data between the messages in MQ and the internal Kafka Connect representation - required
4348
mq.record.builder=com.ibm.eventstreams.connect.mqsource.builders.DefaultRecordBuilder

src/main/java/com/ibm/eventstreams/connect/mqsource/MQSourceConnector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ public class MQSourceConnector extends SourceConnector {
166166
CONFIG_DOCUMENTATION_MQ_QUEUE_MANAGER, CONFIG_GROUP_MQ, 1, Width.MEDIUM,
167167
CONFIG_DISPLAY_MQ_QUEUE_MANAGER);
168168

169-
config.define(CONFIG_NAME_MQ_CONNECTION_NAME_LIST, Type.STRING, ConfigDef.NO_DEFAULT_VALUE, Importance.HIGH,
169+
config.define(CONFIG_NAME_MQ_CONNECTION_NAME_LIST, Type.STRING, null, Importance.MEDIUM,
170170
CONFIG_DOCUMENTATION_MQ_CONNNECTION_NAME_LIST, CONFIG_GROUP_MQ, 2, Width.LONG,
171171
CONFIG_DISPLAY_MQ_CONNECTION_NAME_LIST);
172172

173-
config.define(CONFIG_NAME_MQ_CHANNEL_NAME, Type.STRING, ConfigDef.NO_DEFAULT_VALUE, Importance.HIGH,
173+
config.define(CONFIG_NAME_MQ_CHANNEL_NAME, Type.STRING, null, Importance.MEDIUM,
174174
CONFIG_DOCUMENTATION_MQ_CHANNEL_NAME, CONFIG_GROUP_MQ, 3, Width.MEDIUM,
175175
CONFIG_DISPLAY_MQ_CHANNEL_NAME);
176176

0 commit comments

Comments
 (0)