Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2023 MarkLogic Corporation.
Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Expand Down
44 changes: 23 additions & 21 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
MarkLogic® Connector for Kafka

Copyright © 2023 MarkLogic Corporation. MarkLogic and MarkLogic logo are trademarks or registered trademarks of MarkLogic Corporation in the United States and other countries. All other trademarks are the property of their respective owners.
Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

MarkLogic and MarkLogic logo are trademarks or registered trademarks of MarkLogic Corporation in the United States and other countries. All other trademarks are the property of their respective owners.

This project is licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at

Expand All @@ -10,12 +12,12 @@ Unless required by applicable law or agreed to in writing, software distributed

To the extent required by the applicable open-source license, a complete machine-readable copy of the source code corresponding to such code is available upon request. This offer is valid to anyone in receipt of this information and shall expire three years following the date of the final distribution of this product version by MarkLogic Corporation. To obtain such source code, send an email to [email protected]. Please specify the product and version for which you are requesting source code.

The following software may be included in this project (last updated October 3, 2023):
The following software may be included in this project (last updated August 7, 2025):

-------------------------------------------------------------------------
Third Party Components

Jackson Annotations 2.14.1
Jackson Annotations 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -27,7 +29,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: http://github.com/FasterXML/jackson

Jackson Core 2.14.1
Jackson Core 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -39,7 +41,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/FasterXML/jackson-core

Jackson Databind 2.14.1
Jackson Databind 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -51,7 +53,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/FasterXML/jackson-databind

Jackson Dataformat 2.14.1
Jackson Dataformat 2.17.2
Attribution Statements
http://wiki.fasterxml.com/JacksonHome

Expand All @@ -63,7 +65,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/FasterXML/jackson-databind

OkHttp 4.10.0
OkHttp 4.12.0
Attribution Statements
http://square.github.io/okhttp/

Expand All @@ -75,7 +77,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp

Okio 3.0.0
Okio 3.6.0
Attribution Statements
https://square.github.io/okio/2.x/okio/jvm/okio/index.html

Expand All @@ -87,7 +89,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/square/okio

JavaMail 1.6.2
JavaMail 2.0.1
Attribution Statements
https://javaee.github.io/javamail/

Expand All @@ -99,7 +101,7 @@ Made available under the Common Development and Distribution License 1.1. See Ap

Source materials are available for download at: https://mvnrepository.com/artifact/com.sun.mail/javax.mail

JavaBeans Activation Framework 1.1
JavaBeans Activation Framework 2.0.1
Attribution Statements
https://www.oracle.com/technetwork/java/index.html

Expand All @@ -111,7 +113,7 @@ Made available under the Common Development and Distribution License 1.0. See Ap

Source materials are available for download at: https://www.oracle.com/technetwork/java/jaf11-139815.html

SLF4J API 1.7.36
SLF4J API 2.0.16
Attribution Statements
http://www.slf4j.org

Expand Down Expand Up @@ -143,7 +145,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Source materials are available for download at: https://github.com/qos-ch/slf4j/tree/master/slf4j-api

Java™ Architecture for XML Binding (JAXB) 2.3.3
Java™ Architecture for XML Binding (JAXB) 3.0.2
Attribution Statements
https://javaee.github.io/jaxb-v2/

Expand Down Expand Up @@ -180,7 +182,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/apache/commons-codec

Apache Commons IO™ 2.11.0
Apache Commons IO™ 2.15.1
Attribution Statements
http://commons.apache.org/proper/commons-io/

Expand Down Expand Up @@ -241,7 +243,7 @@ Made available under the Common Development and Distribution License 1.1. See Ap

Source materials are available for download at: https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api

Apache Commons Collections™ 4.2
Apache Commons Collections™ 4.5
Attribution Statements
https://commons.apache.org/proper/commons-collections/

Expand All @@ -253,7 +255,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://mvnrepository.com/artifact/commons-collections/commons-collections

Apache Commons Lang™ 3.12.0
Apache Commons Lang™ 3.18.0
Attribution Statements
http://commons.apache.org/proper/commons-lang/

Expand All @@ -271,7 +273,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/apache/commons-lang

Apache HttpComponents™ HttpClient 4.5.13
Apache HttpComponents™ HttpClient 5.3.1
Attribution Statements
http://hc.apache.org/httpcomponents-client

Expand All @@ -283,7 +285,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/apache/httpcomponents-client

Apache HttpComponents™ HttpCore 4.4.13
Apache HttpComponents™ HttpCore 5.2.4
Attribution Statements
http://hc.apache.org/httpcomponents-core-ga

Expand Down Expand Up @@ -360,7 +362,7 @@ Copyright (C) 2000-2012 Jason Hunter & Brett McLaughlin.

Source materials are available for download at: https://github.com/hunterhacker/jdom/

Kotlin Standard Library JDK 1.6.20
Kotlin Standard Library JDK 1.9.10
Attribution Statements
http://kotlinlang.org/

Expand All @@ -372,7 +374,7 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-jdk8

Spring Framework 5.3.24
Spring Framework 5.3.39
Attribution Statements
https://projects.spring.io/spring-framework/

Expand All @@ -384,12 +386,12 @@ Made available under the Apache License 2.0. See Appendix for full text.

Source materials are available for download at: https://github.com/spring-projects/spring-framework

Group: com.flipkart.zjsonpatch Name: zjsonpatch Version: 0.4.12
Group: com.flipkart.zjsonpatch Name: zjsonpatch Version: 0.4.16
POM Project URL: https://github.com/flipkart-incubator/zjsonpatch/
POM License: The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2016 flipkart.com zjsonpatch.

Group: jaxen Name: jaxen Version: 1.2.0
Group: jaxen Name: jaxen Version: 2.0.0
Project URL: http://www.cafeconleche.org/jaxen
POM License: BSD License 2.0 - https://raw.githubusercontent.com/jaxen-xpath/jaxen/master/LICENSE.txt
Embedded license files: jaxen-1.2.0.jar/META-INF/LICENSE.txt
Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ dependencies {
testImplementation "ch.qos.logback:logback-classic:1.5.18"
testImplementation "org.slf4j:jcl-over-slf4j:2.0.16"

// Automatic loading of test framework implementation dependencies is deprecated.
// https://docs.gradle.org/current/userguide/upgrading_version_8.html#test_framework_implementation_dependencies
// Without this, once using JUnit 5.12 or higher, Gradle will not find any tests and report an error of:
// org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"

documentation files('LICENSE.txt')
documentation files('NOTICE.txt')
documentation files('README.md')
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/com/marklogic/kafka/connect/ConfigUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 MarkLogic Corporation
* Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,10 +20,14 @@
public interface ConfigUtil {

/**
* Convenience method for getting a boolean value from the parsed Kafka config, returning false if the given key is
* not found. This accounts for the fact that boolean options are expected to have "null" as a default value, which
* ensures in Confluent Platform that the default value is shown as "false". Oddly, if the default value is "false",
* then Confluent Platform seems to erroneously show the default value as "true".
* Convenience method for getting a boolean value from the parsed Kafka config,
* returning false if the given key is
* not found. This accounts for the fact that boolean options are expected to
* have "null" as a default value, which
* ensures in Confluent Platform that the default value is shown as "false".
* Oddly, if the default value is "false",
* then Confluent Platform seems to erroneously show the default value as
* "true".
*
* @param key
* @param parsedConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 MarkLogic Corporation
* Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,8 @@
import java.util.Map;

/**
* Defines how a map of properties read in by Kafka are used to build an instance of DatabaseClientConfig.
* Defines how a map of properties read in by Kafka are used to build an
* instance of DatabaseClientConfig.
*/
public interface DatabaseClientConfigBuilder {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 MarkLogic Corporation
* Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,7 +42,8 @@ public DatabaseClientConfig buildDatabaseClientConfig(Map<String, Object> parsed
clientConfig.setPort((Integer) parsedConfig.get(MarkLogicConfig.CONNECTION_PORT));
clientConfig.setBasePath((String) parsedConfig.get(MarkLogicConfig.CONNECTION_BASE_PATH));

String securityContextType = ((String) parsedConfig.get(MarkLogicConfig.CONNECTION_SECURITY_CONTEXT_TYPE)).toUpperCase();
String securityContextType = ((String) parsedConfig.get(MarkLogicConfig.CONNECTION_SECURITY_CONTEXT_TYPE))
.toUpperCase();
clientConfig.setSecurityContextType(SecurityContextType.valueOf(securityContextType));

String database = (String) parsedConfig.get(MarkLogicConfig.CONNECTION_DATABASE);
Expand Down Expand Up @@ -77,14 +78,16 @@ public DatabaseClientConfig buildDatabaseClientConfig(Map<String, Object> parsed
configureSimpleSsl(clientConfig);
}

clientConfig.setCloudApiKey((String)parsedConfig.get(MarkLogicConfig.CONNECTION_CLOUD_API_KEY));
clientConfig.setCloudApiKey((String) parsedConfig.get(MarkLogicConfig.CONNECTION_CLOUD_API_KEY));

return clientConfig;
}

/**
* This provides a "simple" SSL configuration in that it uses the JVM's default SSLContext and
* a "trust everything" hostname verifier. No default TrustManager is configured because in the absence of one,
* This provides a "simple" SSL configuration in that it uses the JVM's default
* SSLContext and
* a "trust everything" hostname verifier. No default TrustManager is configured
* because in the absence of one,
* the JVM's cacerts file will be used.
*
* @param clientConfig
Expand Down Expand Up @@ -113,10 +116,11 @@ else if ("STRICT".equals(sslHostNameVerifier))

private void configureCustomSslContext(DatabaseClientConfig clientConfig, Map<String, Object> parsedConfig) {
final SecurityContextType securityContextType = clientConfig.getSecurityContextType();
if (SecurityContextType.BASIC.equals(securityContextType) || SecurityContextType.DIGEST.equals(securityContextType)) {
SSLContext sslContext = ConfigUtil.getBoolean(MarkLogicConfig.SSL_MUTUAL_AUTH, parsedConfig) ?
buildTwoWaySslContext(clientConfig.getCertFile(), clientConfig.getCertPassword(), parsedConfig) :
buildOneWaySslContext(parsedConfig);
if (SecurityContextType.BASIC.equals(securityContextType)
|| SecurityContextType.DIGEST.equals(securityContextType)) {
SSLContext sslContext = ConfigUtil.getBoolean(MarkLogicConfig.SSL_MUTUAL_AUTH, parsedConfig)
? buildTwoWaySslContext(clientConfig.getCertFile(), clientConfig.getCertPassword(), parsedConfig)
: buildOneWaySslContext(parsedConfig);
clientConfig.setSslContext(sslContext);
}
}
Expand All @@ -139,7 +143,7 @@ private SSLContext buildTwoWaySslContext(String certFile, String certPassword, M
keyManagerFactory.init(clientKeyStore, certPassword.toCharArray());
sslContext = SSLContext.getInstance(tlsVersion);

TrustManager[] trust = new TrustManager[]{new SimpleX509TrustManager()};
TrustManager[] trust = new TrustManager[] { new SimpleX509TrustManager() };
KeyManager[] key = keyManagerFactory.getKeyManagers();
sslContext.init(key, trust, null);
return sslContext;
Expand All @@ -150,7 +154,7 @@ private SSLContext buildTwoWaySslContext(String certFile, String certPassword, M

private SSLContext buildOneWaySslContext(Map<String, Object> parsedConfig) {
final String tlsVersion = (String) parsedConfig.get(MarkLogicConfig.TLS_VERSION);
TrustManager[] trust = new TrustManager[]{new SimpleX509TrustManager()};
TrustManager[] trust = new TrustManager[] { new SimpleX509TrustManager() };
SSLContext sslContext;
try {
sslContext = SSLContext.getInstance(tlsVersion);
Expand Down
Loading