Skip to content

Commit 149b105

Browse files
committed
feat: Update readme with the new config values
Signed-off-by: Joel Hanson <joelhanson025@gmail.com>
1 parent e9bbc91 commit 149b105

File tree

6 files changed

+83
-55
lines changed

6 files changed

+83
-55
lines changed

.github/ISSUE_TEMPLATE/BUG-REPORT.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ body:
5757
label: Version
5858
description: What version of our software are you running?
5959
options:
60-
- 2.3.0 (Default)
60+
- 2.4.0 (Default)
6161
- 1.3.5
6262
- older (<1.3.5)
6363
validations:

README.md

Lines changed: 58 additions & 37 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 1 addition & 1 deletion
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>2.3.0</version>
23+
<version>2.4.0</version>
2424
<name>kafka-connect-mq-source</name>
2525
<organization>
2626
<name>IBM Corporation</name>

src/integration/java/com/ibm/eventstreams/connect/mqsource/MQSourceTaskIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ public void shouldPreserveDlqHeadersWithErrorInformation() throws Exception {
857857
final Headers headers = dlqRecord.headers();
858858
assertThat(headers.lastWithName("__connect.errors.topic").value())
859859
.isEqualTo("mytopic");
860-
assertThat(headers.lastWithName("__connect.errors.class.name").value())
860+
assertThat(headers.lastWithName("__connect.errors.exception.class.name").value())
861861
.isEqualTo("org.apache.kafka.connect.errors.DataException");
862862
assertThat(headers.lastWithName("__connect.errors.exception.message").value())
863863
.isEqualTo("Converting byte[] to Kafka Connect data failed due to serialization error: ");
@@ -1094,7 +1094,7 @@ public void verifyHeadersWithErrorTolerance() throws Exception {
10941094
// [truncated], schema=Schema{STRING})])
10951095
assertThat(headers.lastWithName("__connect.errors.topic").value())
10961096
.isEqualTo("mytopic");
1097-
assertThat(headers.lastWithName("__connect.errors.class.name").value())
1097+
assertThat(headers.lastWithName("__connect.errors.exception.class.name").value())
10981098
.isEqualTo("org.apache.kafka.connect.errors.DataException");
10991099
assertThat(headers.lastWithName("__connect.errors.exception.message").value())
11001100
.isEqualTo("Converting byte[] to Kafka Connect data failed due to serialization error: ");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public class MQSourceConnector extends SourceConnector {
209209
CONFIG_VALUE_MQ_CLIENT_RECONNECT_OPTION_DISABLED.toLowerCase(Locale.ENGLISH)
210210
};
211211

212-
public static String version = "2.3.0";
212+
public static String version = "2.4.0";
213213

214214
private Map<String, String> configProps;
215215

src/main/java/com/ibm/eventstreams/connect/mqsource/util/ErrorHandler.java

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* Copyright 2025 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.util;
217

318
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -17,7 +32,6 @@
1732
import org.apache.kafka.connect.header.ConnectHeaders;
1833
import org.apache.kafka.connect.header.Headers;
1934
import org.apache.kafka.connect.runtime.ConnectorConfig;
20-
import org.apache.kafka.connect.runtime.errors.DeadLetterQueueReporter;
2135
import org.apache.kafka.connect.runtime.errors.ToleranceType;
2236
import org.apache.kafka.connect.source.SourceRecord;
2337
import org.slf4j.Logger;
@@ -35,12 +49,6 @@ public class ErrorHandler {
3549

3650
public static final String HEADER_PREFIX = "__connect.errors.";
3751
public static final String ERROR_HEADER_ORIG_TOPIC = HEADER_PREFIX + "topic";
38-
public static final String ERROR_HEADER_ORIG_PARTITION = HEADER_PREFIX + "partition";
39-
public static final String ERROR_HEADER_ORIG_OFFSET = HEADER_PREFIX + "offset";
40-
public static final String ERROR_HEADER_CONNECTOR_NAME = HEADER_PREFIX + "connector.name";
41-
public static final String ERROR_HEADER_TASK_ID = HEADER_PREFIX + "task.id";
42-
public static final String ERROR_HEADER_STAGE = HEADER_PREFIX + "stage";
43-
public static final String ERROR_HEADER_EXECUTING_CLASS = HEADER_PREFIX + "class.name";
4452
public static final String ERROR_HEADER_EXCEPTION = HEADER_PREFIX + "exception.class.name";
4553
public static final String ERROR_HEADER_EXCEPTION_MESSAGE = HEADER_PREFIX + "exception.message";
4654
public static final String ERROR_HEADER_EXCEPTION_STACK_TRACE = HEADER_PREFIX + "exception.stacktrace";
@@ -113,7 +121,6 @@ private void initializeErrorTolerance(final Map<String, String> props) {
113121
dlqTopic = props.get(MQSourceConnector.DLQ_TOPIC_NAME_CONFIG);
114122
if (dlqTopic != null && !dlqTopic.isEmpty()) {
115123
dlqTopic = dlqTopic.trim();
116-
// TODO: Check if DLQ topic exists
117124
}
118125

119126
queueName = props.get(MQSourceConnector.CONFIG_NAME_MQ_QUEUE);
@@ -282,9 +289,9 @@ private Headers createErrorHeaders(final Message message, final String originalT
282289
}
283290

284291
// Basic error information
285-
headers.addString(DeadLetterQueueReporter.ERROR_HEADER_ORIG_TOPIC, originalTopic);
286-
headers.addString(DeadLetterQueueReporter.ERROR_HEADER_EXECUTING_CLASS, exception.getClass().getName());
287-
headers.addString(DeadLetterQueueReporter.ERROR_HEADER_EXCEPTION_MESSAGE, exception.getMessage());
292+
headers.addString(ERROR_HEADER_ORIG_TOPIC, originalTopic);
293+
headers.addString(ERROR_HEADER_EXCEPTION, exception.getClass().getName());
294+
headers.addString(ERROR_HEADER_EXCEPTION_MESSAGE, exception.getMessage());
288295

289296
try {
290297
headers.addString(ERROR_HEADER_JMS_MESSAGE_ID, message.getJMSMessageID());
@@ -298,14 +305,14 @@ private Headers createErrorHeaders(final Message message, final String originalT
298305

299306
// Add cause if available
300307
if (exception.getCause() != null) {
301-
headers.addString(ERROR_HEADER_EXCEPTION_CAUSE_MESSAGE, exception.getCause().getMessage());
302308
headers.addString(ERROR_HEADER_EXCEPTION_CAUSE_CLASS, exception.getCause().getClass().getName());
309+
headers.addString(ERROR_HEADER_EXCEPTION_CAUSE_MESSAGE, exception.getCause().getMessage());
303310
}
304311

305312
// Add first few lines of stack trace (full stack trace might be too large)
306313
final String stackTrace = getStackTrace(exception);
307314
if (stackTrace != null) {
308-
headers.addString(DeadLetterQueueReporter.ERROR_HEADER_EXCEPTION_STACK_TRACE, stackTrace);
315+
headers.addString(ERROR_HEADER_EXCEPTION_STACK_TRACE, stackTrace);
309316
}
310317

311318
return headers;

0 commit comments

Comments
 (0)