Skip to content

Commit

Permalink
chore: create of a new jar without MQ client (#69)
Browse files Browse the repository at this point in the history
- increment version number
- update dependencies in pom.xml to the latest versions
- introduce a new version of the jar that includes all of the dependencies except for the MQ client jar, to allow for deployment using different MQ client jar versions

Signed-off-by: neeraj-laad <[email protected]>
  • Loading branch information
neeraj-laad authored Oct 2, 2024
1 parent a187590 commit 96bf282
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATES/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ body:
label: Version
description: What version of our software are you running?
options:
- 2.2.0 (Default)
- 2.2.1 (Default)
- 1.5.2
- older (<1.5.2)
validations:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/github-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ jobs:
asset_path: ./target/kafka-connect-mq-sink-${{env.VERSION}}-jar-with-dependencies.jar
asset_name: kafka-connect-mq-sink-${{env.VERSION}}-jar-with-dependencies.jar
asset_content_type: application/java-archive
- name: Upload Release Asset With non-MQ Dependencies
id: upload-release-asset-with-dependencies-exc-mq
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/kafka-connect-mq-sink-${{env.VERSION}}-dependencies-exc-mq.jar
asset_name: kafka-connect-mq-sink-${{env.VERSION}}-dependencies-exc-mq.jar
asset_content_type: application/java-archive
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,12 @@ When attempting to send a message to an IBM MQ queue, an MQException with code `
#### Additional tips

- Verify that the length of all properties are correctly set within the allowed limit.
- Do not set the [`JMS_IBM_MQMD_BackoutCount`](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=descriptor-backoutcount-mqlong-mqmd) property.
- Do not set the [`JMS_IBM_MQMD_BackoutCount`](https://www.ibm.com/docs/en/ibm-mq/9.4?topic=descriptor-backoutcount-mqlong-mqmd) property.
- Refer to the IBM MQ documentation for detailed configuration guidance:

- [IBM MQ JMS Message Object Properties](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=application-jms-message-object-properties): This documentation provides details about various properties that can be set on IBM MQ JMS message objects, including their names, types, and descriptions.
- [IBM MQ JMS Message Object Properties](https://www.ibm.com/docs/en/ibm-mq/9.4?topic=application-jms-message-object-properties): This documentation provides details about various properties that can be set on IBM MQ JMS message objects, including their names, types, and descriptions.
- [IBM MQ Developer Community](https://community.ibm.com/community/user/integration/home): The developer community for IBM MQ, where you can find forums, articles, and resources related to development and troubleshooting for IBM MQ.
- [IBM MQ troubleshooting guide](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=mq-troubleshooting-support): IBM guide for troubleshooting common issues and errors in IBM MQ.
- [IBM MQ troubleshooting guide](https://www.ibm.com/docs/en/ibm-mq/9.4?topic=mq-troubleshooting-support): IBM guide for troubleshooting common issues and errors in IBM MQ.

## Support

Expand Down
57 changes: 36 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<groupId>com.ibm.eventstreams.connect</groupId>
<artifactId>kafka-connect-mq-sink</artifactId>
<packaging>jar</packaging>
<version>2.2.0</version>
<version>2.2.1</version>
<name>kafka-connect-mq-sink</name>
<organization>
<name>IBM Corporation</name>
Expand All @@ -45,13 +45,13 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-api</artifactId>
<version>3.4.1</version>
<version>3.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-json</artifactId>
<version>3.4.1</version>
<version>3.7.1</version>
<scope>provided</scope>
</dependency>

Expand All @@ -63,7 +63,7 @@
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>9.3.3.1</version>
<version>9.4.0.5</version>
</dependency>

<dependency>
Expand All @@ -75,12 +75,12 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
<version>2.0.16</version>
<scope>test</scope>
</dependency>

Expand All @@ -89,7 +89,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.17.2</version>
<version>1.20.2</version>
<scope>test</scope>
</dependency>

Expand All @@ -103,14 +103,14 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<version>3.26.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.3</version>
<version>2.18.0</version>
</dependency>

</dependencies>
Expand All @@ -134,7 +134,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -144,7 +144,7 @@
<!-- run unit tests -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.4.0</version>
<configuration>
<argLine>${surefire.jacoco.args}</argLine>
<systemPropertyVariables>
Expand All @@ -156,7 +156,7 @@
<!-- run integration tests -->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.5.0</version>
<configuration>
<argLine>${failsafe.jacoco.args}</argLine>
<systemPropertyVariables>
Expand All @@ -179,18 +179,33 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<executions>
<!-- an uber jar including all runtime dependencies -->
<execution>
<id>dependencies-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/package.xml</descriptor>
</descriptors>
</configuration>
</execution>
<!-- an uber jar including runtime dependencies other than the MQ client -->
<execution>
<id>dependencies-exc-mq</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assembly/package-excludemq.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/assembly/package.xml</descriptor>
</descriptors>
</configuration>
</plugin>

<!-- add the src/integration folder as a test folder, which lets us keep -->
Expand All @@ -199,7 +214,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
<version>3.6.0</version>
<executions>
<execution>
<id>add-test-source</id>
Expand All @@ -220,7 +235,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.12</version>
<executions>
<execution>
<id>before-unit-test-execution</id>
Expand Down Expand Up @@ -299,7 +314,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
Expand All @@ -324,7 +339,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<version>3.4.0</version>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
Expand Down
44 changes: 44 additions & 0 deletions src/assembly/package-excludemq.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2018, 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* 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.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0
http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>dependencies-exc-mq</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory></outputDirectory>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>**/copyright-exclude</exclude>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/LICENSE*</exclude>
</excludes>
</unpackOptions>
<excludes>
<exclude>com.ibm.mq:com.ibm.mq.allclient</exclude>
</excludes>
<useTransitiveFiltering>true</useTransitiveFiltering>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public abstract class AbstractJMSContextIT {
public static final String CONNECTION_MODE = "client";
public static final String HOST_NAME = "localhost";

public static final String MQ_IMAGE = "icr.io/ibm-messaging/mq:9.3.2.1-r2";
public static final String MQ_IMAGE = "icr.io/ibm-messaging/mq:9.4.0.5-r2";
public static final boolean USER_AUTHENTICATION_MQCSP = false;

protected final ObjectMapper mapper = new ObjectMapper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Message getJMSMessage(JMSContext jmsCtxt, SinkRecord record) {
// JMS_IBM_MQMD_MsgId - byte[]
// JMS_IBM_MQMD_ApplIdentityData - string
// JMS_IBM_MQMD_PutApplName - string
// https://www.ibm.com/docs/en/ibm-mq/9.3?topic=application-jms-message-object-properties
// https://www.ibm.com/docs/en/ibm-mq/9.4?topic=application-jms-message-object-properties
try {
message.setObjectProperty(JmsConstants.JMS_IBM_MQMD_MSGID, "ThisIsMyId".getBytes());
message.setStringProperty(JmsConstants.JMS_IBM_MQMD_APPLIDENTITYDATA, "ThisIsMyApplicationData");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ public class MQSinkConfig {
public static final String CONFIG_DOCUMENTATION_MQ_RETRY_BACKOFF_MS = "Time to wait, in milliseconds, before retrying after retriable exceptions";
public static final String CONFIG_DISPLAY_MQ_RETRY_BACKOFF_MS = "Retry backoff (ms)";

// https://www.ibm.com/docs/en/ibm-mq/9.3?topic=amffmcja-reading-writing-message-descriptor-from-mq-classes-jms-application
// https://www.ibm.com/docs/en/ibm-mq/9.4?topic=amffmcja-reading-writing-message-descriptor-from-mq-classes-jms-application
public static final String CONFIG_NAME_MQ_MQMD_WRITE_ENABLED = "mq.message.mqmd.write";
public static final String CONFIG_DISPLAY_MQ_MQMD_WRITE_ENABLED = "Enable a custom message builder to write MQ message descriptors";
public static final String CONFIG_DOCUMENTATION_MQ_MQMD_WRITE_ENABLED = "This configuration option determines whether the MQMD structure will be written along with the message data. Enabling this option allows control information to accompany the application data during message transmission between sending and receiving applications. Disabling this option will exclude the MQMD structure from the message payload.";

// https://www.ibm.com/docs/en/ibm-mq/9.3?topic=application-jms-message-object-properties
// https://www.ibm.com/docs/en/ibm-mq/9.4?topic=application-jms-message-object-properties
public static final String CONFIG_NAME_MQ_MQMD_MESSAGE_CONTEXT = "mq.message.mqmd.context";
public static final String CONFIG_DISPLAY_MQ_MQMD_MESSAGE_CONTEXT = "Message context to set on the destination queue. This is required when setting some message descriptors.";
public static final String CONFIG_DOCUMENTATION_MQ_MQMD_MESSAGE_CONTEXT = "This configuration option specifies the context in which MQMD properties are applied. Certain properties require this context to be set appropriately for them to take effect. Valid options for WMQ_MQMD_MESSAGE_CONTEXT are IDENTITY for WMQ_MDCTX_SET_IDENTITY_CONTEXT or ALL for WMQ_MDCTX_SET_ALL_CONTEXT.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class MQSinkConnector extends SinkConnector {
private static final Logger log = LoggerFactory.getLogger(MQSinkConnector.class);

public static String version = "2.2.0";
public static String version = "2.2.1";

private Map<String, String> configProps;

Expand Down

0 comments on commit 96bf282

Please sign in to comment.