Skip to content

Commit 724eabc

Browse files
authored
Merge pull request #114 from jhughes24816/fix-multiple-jms-connections
Fix multiple jms connections
2 parents ebc736a + d3f4838 commit 724eabc

File tree

7 files changed

+13
-15
lines changed

7 files changed

+13
-15
lines changed

.github/ISSUE_TEMPLATE/BUG-REPORT.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ body:
5757
label: Version
5858
description: What version of our software are you running?
5959
options:
60-
- 1.3.2 (Default)
61-
- older (<1.3.2)
60+
- 1.3.3 (Default)
61+
- older (<1.3.3)
6262
validations:
6363
required: true
6464
- type: textarea

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPY --chown=esuser:esgroup --from=builder /opt/kafka/libs/ /opt/kafka/libs/
1010
COPY --chown=esuser:esgroup --from=builder /opt/kafka/config/connect-distributed.properties /opt/kafka/config/
1111
COPY --chown=esuser:esgroup --from=builder /opt/kafka/config/connect-log4j.properties /opt/kafka/config/
1212
RUN mkdir /opt/kafka/logs && chown esuser:esgroup /opt/kafka/logs
13-
COPY --chown=esuser:esgroup target/kafka-connect-mq-source-1.3.2-jar-with-dependencies.jar /opt/kafka/libs/
13+
COPY --chown=esuser:esgroup target/kafka-connect-mq-source-1.3.3-jar-with-dependencies.jar /opt/kafka/libs/
1414

1515
WORKDIR /opt/kafka
1616

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ curl -X POST -H "Content-Type: application/json" http://localhost:8083/connector
9292
This repository includes an example Dockerfile to run Kafka Connect in distributed mode. It also adds in the MQ source connector as an available connector plugin. It uses the default `connect-distributed.properties` and `connect-log4j.properties` files.
9393

9494
1. `mvn clean package`
95-
1. `docker build -t kafkaconnect-with-mq-source:1.3.2 .`
96-
1. `docker run -p 8083:8083 kafkaconnect-with-mq-source:1.3.2`
95+
1. `docker build -t kafkaconnect-with-mq-source:1.3.3 .`
96+
1. `docker run -p 8083:8083 kafkaconnect-with-mq-source:1.3.3`
9797

9898
**NOTE:** To provide custom properties files create a folder called `config` containing the `connect-distributed.properties` and `connect-log4j.properties` files and use a Docker volume to make them available when running the container like this:
9999

100100
``` shell
101-
docker run -v $(pwd)/config:/opt/kafka/config -p 8083:8083 kafkaconnect-with-mq-source:1.3.2
101+
docker run -v $(pwd)/config:/opt/kafka/config -p 8083:8083 kafkaconnect-with-mq-source:1.3.3
102102
```
103103

104104
To start the MQ connector, you can use `config/mq-source.json` in this repository after replacing all placeholders and use a command like this:

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<groupId>com.ibm.eventstreams.connect</groupId>
2121
<artifactId>kafka-connect-mq-source</artifactId>
2222
<packaging>jar</packaging>
23-
<version>1.3.2</version>
23+
<version>1.3.3</version>
2424
<name>kafka-connect-mq-source</name>
2525
<organization>
2626
<name>IBM Corporation</name>
@@ -63,7 +63,7 @@
6363
<dependency>
6464
<groupId>com.ibm.mq</groupId>
6565
<artifactId>com.ibm.mq.allclient</artifactId>
66-
<version>9.1.5.0</version>
66+
<version>9.3.0.0</version>
6767
</dependency>
6868

6969
<dependency>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class JMSReader {
7979
private AtomicBoolean closeNow = new AtomicBoolean(); // Whether close has been requested
8080
private long reconnectDelayMillis = reconnectDelayMillisMin; // Delay between repeated reconnect attempts
8181

82-
private static long receiveTimeout = 30000L;
82+
private static long receiveTimeout = 2000L;
8383
private static long reconnectDelayMillisMin = 64L;
8484
private static long reconnectDelayMillisMax = 8192L;
8585

@@ -258,10 +258,8 @@ public SourceRecord receive(final boolean wait) {
258258
SourceRecord sr = null;
259259
try {
260260
if (wait) {
261-
while (m == null && !closeNow.get()) {
262-
log.debug("Waiting {} ms for message", receiveTimeout);
263-
m = jmsCons.receive(receiveTimeout);
264-
}
261+
log.debug("Waiting {} ms for message", receiveTimeout);
262+
m = jmsCons.receive(receiveTimeout);
265263

266264
if (m == null) {
267265
log.debug("No message received");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public class MQSourceConnector extends SourceConnector {
136136
public static final String CONFIG_DOCUMENTATION_TOPIC = "The name of the target Kafka topic.";
137137
public static final String CONFIG_DISPLAY_TOPIC = "Target Kafka topic";
138138

139-
public static String version = "1.3.2";
139+
public static String version = "1.3.3";
140140

141141
private Map<String, String> configProps;
142142

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public List<SourceRecord> poll() throws InterruptedException {
119119

120120
try {
121121
if (!stopNow.get()) {
122-
log.info("Polling for records");
122+
log.debug("Polling for records");
123123
SourceRecord src;
124124
do {
125125
// For the first message in the batch, wait a while if no message

0 commit comments

Comments
 (0)