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

feat: new config to control constants in JMSWorker #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Joel-hanson
Copy link
Contributor

@Joel-hanson Joel-hanson commented Nov 22, 2024

feat: new config to control constants in JMSWorker

Description

  • New config for JMS receive timeout
  • New config for JMS reconnect minimum delay
  • New config for JMS reconnect maximum delay

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

@dalelane dalelane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for picking this up - I've got a few minor comments, but functionally this is looking great

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 2.2.1 (Default)
- 2.3.0 (Default)

IMO, when doing semver, the patch number is for bug fixes, but new (compatible) features should increment the minor number.

README.md Outdated Show resolved Hide resolved
@@ -20,7 +20,7 @@
<groupId>com.ibm.eventstreams.connect</groupId>
<artifactId>kafka-connect-mq-source</artifactId>
<packaging>jar</packaging>
<version>2.2.0</version>
<version>2.2.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<version>2.2.1</version>
<version>2.3.0</version>

rationale as above

README.md Outdated
@@ -305,6 +305,9 @@ The configuration options for the Kafka Connect source connector for IBM MQ are
| mq.message.mqmd.read | Whether to enable reading of all MQMD fields | boolean | false | |
| mq.max.poll.blocked.time.ms | How long the connector will wait for the previous batch of messages to be delivered to Kafka before starting a new poll | integer | 2000 | It is important that this is less than the time defined for `task.shutdown.graceful.timeout.ms` as that is how long connect will wait for the task to perform lifecycle operations. |
| mq.client.reconnect.options | Options governing MQ reconnection. | string | ASDEF | ASDEF, ANY, QMGR, DISABLED |
| mq.jms.receive.timeout | The timeout in milliseconds for receiving messages from JMS Consumer. | long | 2000L | 1 or greater |
| mq.jms.reconnect.delay.min.ms | The minimum delay in milliseconds for reconnect attempts. | long | 64L | 1 or greater |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a risk that users will misunderstand this and confuse it with the JMS client reconnect feature - https://www.ibm.com/docs/en/ibm-mq/9.2?topic=reconnection-using-automatic-jms-client

It's unfortunate, because the name you've used is absolutely the most obvious and logical name. But I think we should name it differently to make it clear that this is how long the connector will pause after an exception before it tries again.

(Also, I recommend removing the "L" from the default value, as above)

README.md Outdated
@@ -305,6 +305,9 @@ The configuration options for the Kafka Connect source connector for IBM MQ are
| mq.message.mqmd.read | Whether to enable reading of all MQMD fields | boolean | false | |
| mq.max.poll.blocked.time.ms | How long the connector will wait for the previous batch of messages to be delivered to Kafka before starting a new poll | integer | 2000 | It is important that this is less than the time defined for `task.shutdown.graceful.timeout.ms` as that is how long connect will wait for the task to perform lifecycle operations. |
| mq.client.reconnect.options | Options governing MQ reconnection. | string | ASDEF | ASDEF, ANY, QMGR, DISABLED |
| mq.jms.receive.timeout | The timeout in milliseconds for receiving messages from JMS Consumer. | long | 2000L | 1 or greater |
| mq.jms.reconnect.delay.min.ms | The minimum delay in milliseconds for reconnect attempts. | long | 64L | 1 or greater |
| mq.jms.reconnect.delay.max.ms | The maximum delay in milliseconds for reconnect attempts. | long | 8192L | 1 or greater |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same comment as for the min value above)

@@ -175,7 +190,7 @@ public class MQSourceConnector extends SourceConnector {
CONFIG_VALUE_MQ_CLIENT_RECONNECT_OPTION_DISABLED.toLowerCase(Locale.ENGLISH)
};

public static String version = "2.2.0";
public static String version = "2.2.1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static String version = "2.2.1";
public static String version = "2.3.0";

as above

@@ -531,6 +546,30 @@ null, new ReadableFile(),
CONFIG_GROUP_MQ, 25,
Width.SHORT,
CONFIG_DISPLAY_MQ_CLIENT_RECONNECT_OPTIONS);
CONFIGDEF.define(CONFIG_MAX_RECEIVE_TIMEOUT,
Type.LONG,
CONFIG_MAX_RECEIVE_TIMEOUT_DEFAULT, ConfigDef.Range.atLeast(0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different minimum to what you've specified in the README.

Did you mean to allow the value 0?

CONFIG_DISPLAY_MAX_RECEIVE_TIMEOUT);
CONFIGDEF.define(CONFIG_RECONNECT_DELAY_MIN,
Type.LONG,
CONFIG_RECONNECT_DELAY_MIN_DEFAULT, ConfigDef.Range.atLeast(0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different minimum to what you've specified in the README.

Did you mean to allow the value 0?

CONFIG_DISPLAY_RECONNECT_DELAY_MIN);
CONFIGDEF.define(CONFIG_RECONNECT_DELAY_MAX,
Type.LONG,
CONFIG_RECONNECT_DELAY_MAX_DEFAULT, ConfigDef.Range.atLeast(0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different minimum to what you've specified in the README.

Did you mean to allow the value 0?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
- New config for JMS receive timeout
- New config for JMS reconnect minimum delay
- New config for JMS reconnect maximum delay

Signed-off-by: Joel Hanson <[email protected]>
@Joel-hanson Joel-hanson force-pushed the fix-jms-work-with-custom-consumer-and-reconnect-values branch from b5c0a4a to be56af6 Compare November 29, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants