Skip to content

Commit d9a1a86

Browse files
committed
Changes based on review comments
1 parent bc467bd commit d9a1a86

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public class MQSourceConnector extends SourceConnector {
285285
CONFIG_DOCUMENTATION_MQ_MESSAGE_MQMD_READ, CONFIG_GROUP_MQ, 19, Width.SHORT,
286286
CONFIG_DISPLAY_MQ_MESSAGE_MQMD_READ);
287287

288-
config.define(CONFIG_NAME_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER, Type.BOOLEAN, Boolean.TRUE, Importance.LOW,
288+
config.define(CONFIG_NAME_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER, Type.BOOLEAN, Boolean.FALSE, Importance.LOW,
289289
CONFIG_DOCUMENTATION_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER, CONFIG_GROUP_MQ, 20, Width.MEDIUM,
290290
CONFIG_DISPLAY_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER);
291291

src/main/java/com/ibm/eventstreams/connect/mqsource/builders/BaseRecordBuilder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import javax.jms.JMSException;
3030
import javax.jms.Message;
3131
import java.util.Map;
32+
import java.util.Optional;
3233

3334
/**
3435
* Builds Kafka Connect SourceRecords from messages.
@@ -40,7 +41,7 @@ public enum KeyHeader {NONE, MESSAGE_ID, CORRELATION_ID, CORRELATION_ID_AS_BYTES
4041
protected KeyHeader keyheader = KeyHeader.NONE;
4142

4243

43-
private Boolean copyJmsPropertiesFlag = Boolean.FALSE;
44+
private boolean copyJmsPropertiesFlag = Boolean.FALSE;
4445
private JmsToKafkaHeaderConverter jmsToKafkaHeaderConverter;
4546

4647
/**
@@ -79,7 +80,10 @@ else if (kh.equals(MQSourceConnector.CONFIG_VALUE_MQ_RECORD_BUILDER_KEY_HEADER_J
7980

8081
String str = props.get(MQSourceConnector.CONFIG_NAME_MQ_JMS_PROPERTY_COPY_TO_KAFKA_HEADER);
8182

82-
copyJmsPropertiesFlag = Boolean.parseBoolean(str);
83+
if (Optional.of(str).isPresent()) {
84+
copyJmsPropertiesFlag = Boolean.parseBoolean(str);
85+
}
86+
8387
jmsToKafkaHeaderConverter = new JmsToKafkaHeaderConverter();
8488

8589

src/main/java/com/ibm/eventstreams/connect/mqsource/processor/JmsToKafkaHeaderConverter.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* Copyright 2017, 2018, 2019 IBM Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.ibm.eventstreams.connect.mqsource.processor;
217

318
import org.apache.kafka.connect.header.ConnectHeaders;

src/test/java/com/ibm/eventstreams/connect/mqsource/JmsToKafkaHeaderConverterTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* Copyright 2017, 2018, 2019 IBM Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.ibm.eventstreams.connect.mqsource;
217

318
import com.ibm.eventstreams.connect.mqsource.processor.JmsToKafkaHeaderConverter;

0 commit comments

Comments
 (0)