Skip to content

Commit 8115f31

Browse files
committed
Fetched latest master code and fixed merge conflict
2 parents 75ab0d7 + bff4081 commit 8115f31

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ If you write your own RecordBuilder, you can access the MQMD fields of the MQ me
196196

197197

198198
## Security
199-
The connector supports authentication with user name and password and also connections secured with TLS using a server-side certificate and mutual authentication with client-side certificates.
199+
The connector supports authentication with user name and password and also connections secured with TLS using a server-side certificate and mutual authentication with client-side certificates. You can also choose whether to use connection security parameters (MQCSP) depending on the security settings you're using in MQ.
200200

201201
### Setting up MQ connectivity using TLS with a server-side certificate
202202
To enable use of TLS, set the configuration `mq.ssl.cipher.suite` to the name of the cipher suite which matches the CipherSpec in the SSLCIPH attribute of the MQ server-connection channel. Use the table of supported cipher suites for MQ 9.1 [here](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q113220_.htm) as a reference. Note that the names of the CipherSpecs as used in the MQ configuration are not necessarily the same as the cipher suite names that the connector uses. The connector uses the JMS interface so it follows the Java conventions.
@@ -234,8 +234,10 @@ The configuration options for the Kafka Connect source connector for IBM MQ are
234234
| mq.ssl.truststore.password | The password of the JKS truststore to use for SSL (TLS) connections | string | | |
235235
| mq.batch.size | The maximum number of messages in a batch (unit of work) | integer | 250 | 1 or greater |
236236
| mq.message.mqmd.read | Whether to enable reading of all MQMD fields | boolean | false | |
237+
| mq.user.authentication.mqcsp | Whether to use MQ connection security parameters (MQCSP) | boolean | true | |
237238
| topic | The name of the target Kafka topic | string | | Topic name |
238239

240+
239241
### Using a CCDT file
240242
Some of the connection details for MQ can be provided in a [CCDT file](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.con.doc/q016730_.htm) by setting `mq.ccdt.url` in the MQ source connector configuration file. If using a CCDT file the `mq.connection.name.list` and `mq.channel.name` configuration options are not required.
241243

config/mq-source.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ mq.queue=
4545
# depending on the ConfigProvider implementation.
4646
# mq.password=${file:/var/run/secret.properties:secret-key}
4747

48+
# Whether to use MQ connection security parameters (MQCSP) to provide credentials - optional
49+
# mq.user.authentication.mqcsp=
50+
4851
# The CCDT URL to use to establish a client connection to the queue manager - optional
4952
# mq.ccdt.url=
5053

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public void configure(Map<String, String> props) {
107107
String sslKeystorePassword = props.get(MQSourceConnector.CONFIG_NAME_MQ_SSL_KEYSTORE_PASSWORD);
108108
String sslTruststoreLocation = props.get(MQSourceConnector.CONFIG_NAME_MQ_SSL_TRUSTSTORE_LOCATION);
109109
String sslTruststorePassword = props.get(MQSourceConnector.CONFIG_NAME_MQ_SSL_TRUSTSTORE_PASSWORD);
110+
String useMQCSP = props.get(MQSourceConnector.CONFIG_NAME_MQ_USER_AUTHENTICATION_MQCSP);
110111
String topic = props.get(MQSourceConnector.CONFIG_NAME_TOPIC);
111112

112113
int transportType = WMQConstants.WMQ_CM_CLIENT;
@@ -128,6 +129,9 @@ else if (connectionMode.equals(MQSourceConnector.CONFIG_VALUE_MQ_CONNECTION_MODE
128129
mqConnFactory.setTransportType(transportType);
129130
mqConnFactory.setQueueManager(queueManager);
130131
mqConnFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, true);
132+
if (useMQCSP != null) {
133+
mqConnFactory.setBooleanProperty(WMQConstants.USER_AUTHENTICATION_MQCSP, Boolean.parseBoolean(useMQCSP));
134+
}
131135

132136
if (transportType == WMQConstants.WMQ_CM_CLIENT) {
133137
if (ccdtUrl != null) {

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ public class MQSourceConnector extends SourceConnector {
123123
public static final String CONFIG_DOCUMENTATION_MQ_MESSAGE_MQMD_READ = "Whether to enable reading of all MQMD fields.";
124124
public static final String CONFIG_DISPLAY_MQ_MESSAGE_MQMD_READ = "Enable reading of MQMD fields";
125125

126-
public static final String CONFIG_NAME_TOPIC = "topic";
126+
127+
public static final String CONFIG_NAME_MQ_USER_AUTHENTICATION_MQCSP = "mq.user.authentication.mqcsp";
128+
public static final String CONFIG_DOCUMENTATION_MQ_USER_AUTHENTICATION_MQCSP = "Whether to use MQ connection security parameters (MQCSP).";
129+
public static final String CONFIG_DISPLAY_MQ_USER_AUTHENTICATION_MQCSP = "User authentication using MQCSP";
130+
131+
public static final String CONFIG_NAME_TOPIC = "topic";
132+
127133
public static final String CONFIG_DOCUMENTATION_TOPIC = "The name of the target Kafka topic.";
128134
public static final String CONFIG_DISPLAY_TOPIC = "Target Kafka topic";
129135

@@ -285,10 +291,16 @@ public class MQSourceConnector extends SourceConnector {
285291
CONFIG_DOCUMENTATION_MQ_MESSAGE_MQMD_READ, CONFIG_GROUP_MQ, 19, Width.SHORT,
286292
CONFIG_DISPLAY_MQ_MESSAGE_MQMD_READ);
287293

294+
config.define(CONFIG_NAME_MQ_USER_AUTHENTICATION_MQCSP, Type.BOOLEAN, Boolean.TRUE, Importance.LOW,
295+
CONFIG_DOCUMENTATION_MQ_USER_AUTHENTICATION_MQCSP, CONFIG_GROUP_MQ, 20, Width.SHORT,
296+
CONFIG_DISPLAY_MQ_USER_AUTHENTICATION_MQCSP);
297+
298+
288299
config.define(CONFIG_NAME_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER, Type.BOOLEAN, Boolean.FALSE, Importance.LOW,
289-
CONFIG_DOCUMENTATION_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER, CONFIG_GROUP_MQ, 20, Width.MEDIUM,
300+
CONFIG_DOCUMENTATION_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER, CONFIG_GROUP_MQ, 21, Width.MEDIUM,
290301
CONFIG_DISPLAY_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER);
291302

303+
292304
config.define(CONFIG_NAME_TOPIC, Type.STRING, ConfigDef.NO_DEFAULT_VALUE, Importance.HIGH,
293305
CONFIG_DOCUMENTATION_TOPIC, null, 0, Width.MEDIUM,
294306
CONFIG_DISPLAY_TOPIC);

0 commit comments

Comments
 (0)