-
Notifications
You must be signed in to change notification settings - Fork 84
feat: Expose one config adjust the blocking behavior [QP-466] #149
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
Conversation
3225272
to
9dc0948
Compare
- Enhancement to the IBM MQ Source Connector to expose two configurable values to adjust the blocking behavior of the JMS receive methods when retrieving messages from MQ Signed-off-by: Joel Hanson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking very good - the config option rename is a bit of a blocker IMO, but otherwise I had only minor/cosmetic comments
@@ -71,12 +71,17 @@ public class JMSWorker { | |||
private boolean connected = false; // Whether connected to MQ | |||
private AtomicBoolean closeNow; // Whether close has been requested | |||
private AbstractConfig config; | |||
private long receiveTimeout; // Receive timeout for the jms consumer | |||
private long initialReceiveTimeoutMs; // Receive timeout for the jms consumer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private long initialReceiveTimeoutMs; // Receive timeout for the jms consumer | |
private long initialReceiveTimeoutMs; // Receive timeout for the jms consumer on the first call in each Connect poll |
CONFIG_DOCUMENTATION_MAX_RECEIVE_TIMEOUT, | ||
CONFIG_GROUP_MQ, 26, | ||
Width.MEDIUM, | ||
"MQ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MQ", | |
CONFIG_GROUP_MQ, |
CONFIG_SUBSEQUENT_RECEIVE_TIMEOUT_DEFAULT, | ||
ConfigDef.Importance.LOW, | ||
CONFIG_DOCUMENTATION_SUBSEQUENT_RECEIVE_TIMEOUT, | ||
"MQ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MQ", | |
CONFIG_GROUP_MQ, |
@@ -163,12 +163,18 @@ public class MQSourceConnector extends SourceConnector { | |||
public static final String CONFIG_VALUE_MQ_CLIENT_RECONNECT_OPTION_DISABLED = "DISABLED"; | |||
public static final String CONFIG_VALUE_MQ_CLIENT_RECONNECT_OPTION_ASDEF = "ASDEF"; | |||
|
|||
public static final String CONFIG_MAX_RECEIVE_TIMEOUT = "mq.message.receive.timeout"; | |||
public static final String CONFIG_MAX_RECEIVE_TIMEOUT = "mq.receive.timeout.ms"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static final String CONFIG_MAX_RECEIVE_TIMEOUT = "mq.receive.timeout.ms"; | |
public static final String CONFIG_MAX_RECEIVE_TIMEOUT = "mq.message.receive.timeout"; |
While I think your proposed name would be an improvement, I'm afraid it's too late to change this now - some existing deployments of the connector could potentially be using the existing mq.message.receive.timeout
config to modify the timeout, which would stop having an impact if we made this change.
It's okay for us to add new config options (with defaults that maintain existing behaviour) but we can't remove or rename existing config options (without a major version bump at least)
public static final String CONFIG_DOCUMENTATION_MAX_RECEIVE_TIMEOUT = "How long the connector should wait (in milliseconds) for a message to arrive if no message is available immediately"; | ||
public static final String CONFIG_DISPLAY_MAX_RECEIVE_TIMEOUT = "message receive timeout"; | ||
public static final String CONFIG_DISPLAY_MAX_RECEIVE_TIMEOUT = "Initial receive timeout (ms)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating the description is fine, though
README.md
Outdated
| 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.receive.timeout.ms | The timeout (in milliseconds) for receiving messages from the queue manager before returning to Kafka Connect. | long | 2000 | 1 or greater | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| mq.receive.timeout.ms | The timeout (in milliseconds) for receiving messages from the queue manager before returning to Kafka Connect. | long | 2000 | 1 or greater | | |
| mq.receive.timeout.ms | The timeout (in milliseconds) for the first request to receiving messages from the queue manager before returning to Kafka Connect. | long | 2000 | 1 or greater | |
b662a8e
to
5c4aab4
Compare
Signed-off-by: Joel Hanson <[email protected]>
5c4aab4
to
886a53c
Compare
Description
mq.message.receive.timeout
->mq.receive.timeout.ms
: Timeout (ms) for the initial receive call.mq.receive.subsequent.timeout.ms
: Timeout (ms) for subsequent receives.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist