Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQ V2 OSS release #136

Merged
merged 10 commits into from
Aug 7, 2024
Merged
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
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ body:
label: Version
description: What version of our software are you running?
options:
- 1.3.5 (Default)
- 2.1.0 (Default)
- 1.3.5
- older (<1.3.5)
validations:
required: true
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ target/
*.iws

# Visual Studio Code
.vscode/
.vscode/

mqjms.log.*
/src/main/resources/simplelogger.properties
.envrc
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM alpine as builder
RUN apk update
RUN apk --no-cache add curl

RUN curl -L "https://downloads.apache.org/kafka/3.4.1/kafka_2.12-3.4.1.tgz" -o kafka.tgz
RUN curl -L "https://downloads.apache.org/kafka/3.6.2/kafka_2.12-3.6.2.tgz" -o kafka.tgz
RUN mkdir /opt/kafka \
&& tar -xf kafka.tgz -C /opt/kafka --strip-components=1

Expand All @@ -27,4 +27,4 @@ EXPOSE 8083

Joel-hanson marked this conversation as resolved.
Show resolved Hide resolved
USER esuser

ENTRYPOINT ["./bin/connect-distributed.sh", "config/connect-distributed.properties"]
ENTRYPOINT ["./bin/connect-distributed.sh", "config/connect-distributed.properties"]
Joel-hanson marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Apache License

END OF TERMS AND CONDITIONS

Copyright 2017 IBM Corporation
Copyright 2017, 2024 IBM Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
122 changes: 86 additions & 36 deletions README.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions config/mq-source-exactly-once.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "mq-source-exactly-once",
"config":
{
"connector.class": "com.ibm.eventstreams.connect.mqsource.MQSourceConnector",
"tasks.max": "1",
"topic": "<TOPIC>",

"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.storage.StringConverter",

"mq.queue.manager": "<QUEUE_MANAGER>",
"mq.connection.name.list": "<CONNECTION_NAME_LIST>",
"mq.channel.name": "<CHANNEL_NAME>",
"mq.queue": "<QUEUE>",
"mq.record.builder": "com.ibm.eventstreams.connect.mqsource.builders.DefaultRecordBuilder",
"mq.exactly.once.state.queue": "<EXACTLY_ONCE_STATE_QUEUE>"
}
}
8 changes: 7 additions & 1 deletion config/mq-source.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017, 2020 IBM Corporation
# Copyright 2017, 2020, 2023, 2024 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,8 @@ name=mq-source
connector.class=com.ibm.eventstreams.connect.mqsource.MQSourceConnector

# You can increase this for higher throughput, but message ordering will be lost
# Exactly-once message delivery requires tasks.max to be 1
# (see README.md for more details).
tasks.max=1

# The name of the target Kafka topic - required
Expand All @@ -37,6 +39,10 @@ mq.channel.name=
# The name of the source MQ queue - required
mq.queue=

# This is required for exactly-once delivery. If not supplied, message delivery will be at-least-once.
# (see README.md for more details).
# mq.exactly.once.state.queue=

# The user name for authenticating with the queue manager - optional
# mq.user.name=

Expand Down
79 changes: 51 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2017, 2020, 2023 IBM Corporation
* Copyright 2017, 2020, 2023, 2024 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,15 +13,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-->
Joel-hanson marked this conversation as resolved.
Show resolved Hide resolved
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm.eventstreams.connect</groupId>
<artifactId>kafka-connect-mq-source</artifactId>
<packaging>jar</packaging>
<version>1.3.5</version>
<version>2.1.0</version>
<name>kafka-connect-mq-source</name>
<organization>
<name>IBM Corporation</name>
Expand All @@ -46,13 +45,13 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-api</artifactId>
<version>3.4.0</version>
<version>3.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-json</artifactId>
<version>3.4.0</version>
<version>3.6.2</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -81,14 +80,14 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
<!-- tests in src/integration depend on a running MQ queue manager -->
<!-- in a container, configured using org.testcontainers -->
Expand All @@ -98,10 +97,34 @@
<version>1.17.6</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>LICENSE</include>
</includes>
</resource>
</resources>
</configuration>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
Expand All @@ -121,6 +144,9 @@
<systemPropertyVariables>
<connectorVersion>${project.version}</connectorVersion>
</systemPropertyVariables>
<additionalClasspathElements>
<additionalClasspathElement>src/test/resources</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>

Expand All @@ -133,6 +159,9 @@
<systemPropertyVariables>
<connectorVersion>${project.version}</connectorVersion>
</systemPropertyVariables>
<additionalClasspathElements>
<additionalClasspathElement>src/test/resources</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -187,7 +216,6 @@
</executions>
</plugin>


<!-- generate test code coverage report -->
<plugin>
<groupId>org.jacoco</groupId>
Expand All @@ -200,8 +228,7 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>
${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile>
<destFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile>
<propertyName>surefire.jacoco.args</propertyName>
</configuration>
</execution>
Expand All @@ -212,10 +239,9 @@
<goal>report</goal>
</goals>
<configuration>
<dataFile>
${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</dataFile>
<outputDirectory>
${project.reporting.outputDirectory}/jacoco-unit-test-coverage-report</outputDirectory>
<dataFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-unit-test-coverage-report
</outputDirectory>
</configuration>
</execution>
<execution>
Expand All @@ -225,8 +251,7 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>
${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile>
<destFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile>
<propertyName>failsafe.jacoco.args</propertyName>
</configuration>
</execution>
Expand All @@ -237,10 +262,10 @@
<goal>report</goal>
</goals>
<configuration>
<dataFile>
${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</dataFile>
<dataFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</dataFile>
<outputDirectory>
${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report</outputDirectory>
${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report
</outputDirectory>
</configuration>
</execution>
<execution>
Expand Down Expand Up @@ -269,18 +294,18 @@
</goals>
<configuration>
<dataFile>${project.build.directory}/jacoco-output/merged.exec</dataFile>
<outputDirectory>
${project.reporting.outputDirectory}/jacoco-merged-test-coverage-report</outputDirectory>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-merged-test-coverage-report
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<violationSeverity>warning</violationSeverity>
Expand All @@ -301,8 +326,6 @@
</executions>
</plugin>
</plugins>

<!-- some integration tests use the custom mqsc file in the resources directory -->
<testResources>
<testResource>
<directory>src/integration/resources</directory>
Expand Down
3 changes: 2 additions & 1 deletion src/assembly/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2018 IBM Corporation
* Copyright 2018, 2024 IBM Corporation
*
* 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 @@ -37,6 +37,7 @@
<excludes>
<exclude>**/copyright-exclude</exclude>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/LICENSE*</exclude>
</excludes>
</unpackOptions>
<useTransitiveFiltering>true</useTransitiveFiltering>
Expand Down
Loading
Loading