Skip to content

Commit bc467bd

Browse files
committed
refactoring, code formatting based on review comments
1 parent bbbd128 commit bc467bd

File tree

16 files changed

+1555
-1458
lines changed

16 files changed

+1555
-1458
lines changed

config/mq-source.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
2-
"name": "mq-source",
3-
"config": {
4-
"connector.class": "com.ibm.eventstreams.connect.mqsource.MQSourceConnector",
5-
"tasks.max": "1",
6-
"topic": "<TOPIC>",
7-
"value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter",
8-
"mq.queue.manager": "<QUEUE_MANAGER>",
9-
"mq.connection.name.list": "<CONNECTION_NAME_LIST>",
10-
"mq.channel.name": "<CHANNEL_NAME>",
11-
"mq.queue": "<QUEUE>",
12-
"mq.record.builder": "com.ibm.eventstreams.connect.mqsource.builders.DefaultRecordBuilder"
13-
}
2+
"name": "mq-source",
3+
"config":
4+
{
5+
"connector.class": "com.ibm.eventstreams.connect.mqsource.MQSourceConnector",
6+
"tasks.max": "1",
7+
"topic": "<TOPIC>",
8+
9+
"value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter",
10+
11+
"mq.queue.manager": "<QUEUE_MANAGER>",
12+
"mq.connection.name.list": "<CONNECTION_NAME_LIST>",
13+
"mq.channel.name": "<CHANNEL_NAME>",
14+
"mq.queue": "<QUEUE>",
15+
"mq.record.builder": "com.ibm.eventstreams.connect.mqsource.builders.DefaultRecordBuilder"
16+
}
1417
}

config/mq-source.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,73 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
name=mq-source
1516
connector.class=com.ibm.eventstreams.connect.mqsource.MQSourceConnector
17+
1618
# You can increase this for higher throughput, but message ordering will be lost
1719
tasks.max=1
20+
1821
# The name of the MQ queue manager - required
1922
mq.queue.manager=
23+
2024
# The connection mode to connect to MQ - client (default) or bindings - optional
2125
# mq.connection.mode=client
2226
# mq.connection.mode=bindings
27+
2328
# A list of one or more host(port) entries for connecting to the queue manager. Entries are separated with a comma - required (unless using bindings or CCDT)
2429
mq.connection.name.list=
30+
2531
# The name of the server-connection channel - required (unless using bindings or CCDT)
2632
mq.channel.name=
33+
2734
# The name of the source MQ queue - required
2835
mq.queue=
36+
2937
# The user name for authenticating with the queue manager - optional
3038
# mq.user.name=
39+
3140
# The password for authenticating with the queue manager - optional
3241
# mq.password=
42+
3343
# Alternatively can use a ConfigProvider for externalising secrets (see README.md for more details)
3444
# Variable references are of the form ${provider:[path:]key} where the path is optional,
3545
# depending on the ConfigProvider implementation.
3646
# mq.password=${file:/var/run/secret.properties:secret-key}
47+
3748
# The CCDT URL to use to establish a client connection to the queue manager - optional
3849
# mq.ccdt.url=
50+
3951
# The record builders control conversion of data between the messages in MQ and the internal Kafka Connect representation - required
4052
mq.record.builder=com.ibm.eventstreams.connect.mqsource.builders.DefaultRecordBuilder
4153
# mq.record.builder=com.ibm.eventstreams.connect.mqsource.builders.JsonRecordBuilder
54+
4255
# Whether to interpret the message body as a JMS message type (default false) - optional
4356
# mq.message.body.jms=
57+
4458
# The JMS message header to use as the Kafka record key - optional
4559
# Valid values are JMSMessageID, JMSCorrelationID, JMSCorrelationIDAsBytes and JMSDestination
4660
# Don't forget to set key.converter to a compatible converter as described in README.md
4761
# mq.record.builder.key.header=
62+
4863
# The name of the cipher suite for TLS (SSL) connection (default blank, meaning do not use TLS) - optional
4964
# See https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.dev.doc/q113220_.htm for valid values
5065
# mq.ssl.cipher.suite=
66+
5167
# The distinguished name pattern of the TLS (SSL) peer - optional
5268
# mq.ssl.peer.name=
69+
5370
# Whether to enable reading of all MQMD fields (default false) - optional
5471
# mq.message.mqmd.read=
72+
5573
# The name of the target Kafka topic - required
5674
topic=
75+
5776
# The converters control conversion of data between the internal Kafka Connect representation and the messages in Kafka.
5877
# key.converter=org.apache.kafka.connect.converters.ByteArrayConverter
5978
# key.converter=org.apache.kafka.connect.storage.StringConverter
6079
# key.converter=org.apache.kafka.connect.json.JsonConverter
80+
6181
value.converter=org.apache.kafka.connect.converters.ByteArrayConverter
6282
# value.converter=org.apache.kafka.connect.storage.StringConverter
6383
# value.converter=org.apache.kafka.connect.json.JsonConverter

kafka-connect.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ spec:
4444
initialDelaySeconds: 20
4545
periodSeconds: 20
4646
ports:
47-
- containerPort: 8083
47+
- containerPort: 8083
4848
volumeMounts:
49-
- name: connect-config
50-
mountPath: /opt/kafka/config/connect-distributed.properties
51-
subPath: connect-distributed.properties
52-
- name: connect-log4j
53-
mountPath: /opt/kafka/config/connect-log4j.properties
54-
subPath: connect-log4j.properties
49+
- name: connect-config
50+
mountPath: /opt/kafka/config/connect-distributed.properties
51+
subPath: connect-distributed.properties
52+
- name: connect-log4j
53+
mountPath: /opt/kafka/config/connect-log4j.properties
54+
subPath: connect-log4j.properties
5555
volumes:
56-
- name: connect-config
57-
secret:
58-
secretName: connect-distributed-config
59-
- name: connect-log4j
60-
configMap:
61-
name: connect-log4j-config
56+
- name: connect-config
57+
secret:
58+
secretName: connect-distributed-config
59+
- name: connect-log4j
60+
configMap:
61+
name: connect-log4j-config
6262

6363
---
6464
# Service
@@ -75,4 +75,4 @@ spec:
7575
protocol: TCP
7676
port: 8083
7777
selector:
78-
app: kafkaconnect-with-mq-source
78+
app: kafkaconnect-with-mq-source

pom.xml

Lines changed: 105 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -14,116 +14,114 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
-->
17-
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
18-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19-
<modelVersion>4.0.0</modelVersion>
20-
<groupId>com.ibm.eventstreams.connect</groupId>
21-
<artifactId>kafka-connect-mq-source</artifactId>
22-
<packaging>jar</packaging>
23-
<version>1.2.0-SNAPSHOT</version>
24-
<name>kafka-connect-mq-source</name>
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
<groupId>com.ibm.eventstreams.connect</groupId>
21+
<artifactId>kafka-connect-mq-source</artifactId>
22+
<packaging>jar</packaging>
23+
<version>1.2.0-SNAPSHOT</version>
24+
<name>kafka-connect-mq-source</name>
2525
<organization>
26-
<name>IBM Corporation</name>
27-
<url>http://ibm.com</url>
28-
</organization>
26+
<name>IBM Corporation</name>
2927
<url>http://ibm.com</url>
30-
<description>
31-
A Kafka Connect connector for copying data from IBM MQ into Apache Kafka.
32-
</description>
33-
<licenses>
34-
<license>
35-
<name>Apache License 2.0</name>
36-
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
37-
<distribution>repo</distribution>
38-
</license>
39-
</licenses>
40-
<properties>
41-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
43-
</properties>
44-
<dependencies>
45-
<dependency>
46-
<groupId>org.apache.kafka</groupId>
47-
<artifactId>connect-api</artifactId>
48-
<version>2.3.0</version>
49-
<scope>provided</scope>
50-
</dependency>
51-
<dependency>
52-
<groupId>org.apache.kafka</groupId>
53-
<artifactId>connect-json</artifactId>
54-
<version>2.3.0</version>
55-
<scope>provided</scope>
56-
</dependency>
28+
</organization>
29+
<url>http://ibm.com</url>
30+
<description>
31+
A Kafka Connect connector for copying data from IBM MQ into Apache Kafka.
32+
</description>
33+
<licenses>
34+
<license>
35+
<name>Apache License 2.0</name>
36+
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
37+
<distribution>repo</distribution>
38+
</license>
39+
</licenses>
40+
<properties>
41+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
43+
</properties>
44+
<dependencies>
45+
<dependency>
46+
<groupId>org.apache.kafka</groupId>
47+
<artifactId>connect-api</artifactId>
48+
<version>2.3.0</version>
49+
<scope>provided</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.apache.kafka</groupId>
53+
<artifactId>connect-json</artifactId>
54+
<version>2.3.0</version>
55+
<scope>provided</scope>
56+
</dependency>
5757

58-
<dependency>
59-
<groupId>javax.jms</groupId>
60-
<artifactId>javax.jms-api</artifactId>
61-
<version>2.0.1</version>
62-
</dependency>
63-
<dependency>
64-
<groupId>com.ibm.mq</groupId>
65-
<artifactId>com.ibm.mq.allclient</artifactId>
66-
<version>9.1.1.0</version>
67-
</dependency>
58+
<dependency>
59+
<groupId>javax.jms</groupId>
60+
<artifactId>javax.jms-api</artifactId>
61+
<version>2.0.1</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>com.ibm.mq</groupId>
65+
<artifactId>com.ibm.mq.allclient</artifactId>
66+
<version>9.1.1.0</version>
67+
</dependency>
6868

69-
<dependency>
70-
<groupId>junit</groupId>
71-
<artifactId>junit</artifactId>
72-
<version>4.12</version>
73-
<scope>test</scope>
74-
</dependency>
75-
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
76-
<dependency>
77-
<groupId>org.mockito</groupId>
78-
<artifactId>mockito-core</artifactId>
79-
<version>3.1.0</version>
80-
<scope>test</scope>
81-
</dependency>
69+
<dependency>
70+
<groupId>junit</groupId>
71+
<artifactId>junit</artifactId>
72+
<version>4.12</version>
73+
<scope>test</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.mockito</groupId>
77+
<artifactId>mockito-core</artifactId>
78+
<version>3.1.0</version>
79+
<scope>test</scope>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.slf4j</groupId>
83+
<artifactId>slf4j-log4j12</artifactId>
84+
<version>1.7.25</version>
85+
<scope>test</scope>
86+
</dependency>
87+
</dependencies>
8288

83-
<dependency>
84-
<groupId>org.slf4j</groupId>
85-
<artifactId>slf4j-log4j12</artifactId>
86-
<version>1.7.25</version>
87-
<scope>test</scope>
88-
</dependency>
89-
</dependencies>
90-
91-
<build>
92-
<plugins>
93-
<plugin>
94-
<artifactId>maven-compiler-plugin</artifactId>
95-
<version>3.1</version>
96-
<configuration>
97-
<source>1.8</source>
98-
<target>1.8</target>
99-
</configuration>
100-
</plugin>
101-
<plugin>
102-
<artifactId>maven-surefire-plugin</artifactId>
103-
<version>3.0.0-M1</version>
104-
<configuration>
105-
<systemPropertyVariables>
106-
<connectorVersion>${project.version}</connectorVersion>
107-
</systemPropertyVariables>
108-
</configuration>
109-
</plugin>
110-
<plugin>
111-
<artifactId>maven-assembly-plugin</artifactId>
112-
<version>3.1.1</version>
113-
<executions>
114-
<execution>
115-
<phase>package</phase>
116-
<goals>
117-
<goal>single</goal>
118-
</goals>
119-
</execution>
120-
</executions>
121-
<configuration>
122-
<descriptors>
123-
<descriptor>src/assembly/package.xml</descriptor>
124-
</descriptors>
125-
</configuration>
126-
</plugin>
127-
</plugins>
128-
</build>
89+
<build>
90+
<plugins>
91+
<plugin>
92+
<artifactId>maven-compiler-plugin</artifactId>
93+
<version>3.1</version>
94+
<configuration>
95+
<source>1.8</source>
96+
<target>1.8</target>
97+
</configuration>
98+
</plugin>
99+
<plugin>
100+
<artifactId>maven-surefire-plugin</artifactId>
101+
<version>3.0.0-M1</version>
102+
<configuration>
103+
<systemPropertyVariables>
104+
<connectorVersion>${project.version}</connectorVersion>
105+
</systemPropertyVariables>
106+
</configuration>
107+
</plugin>
108+
<plugin>
109+
<artifactId>maven-assembly-plugin</artifactId>
110+
<version>3.1.1</version>
111+
<executions>
112+
<execution>
113+
<phase>package</phase>
114+
<goals>
115+
<goal>single</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
<configuration>
120+
<descriptors>
121+
<descriptor>src/assembly/package.xml</descriptor>
122+
</descriptors>
123+
</configuration>
124+
</plugin>
125+
</plugins>
126+
</build>
129127
</project>

0 commit comments

Comments
 (0)