-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Bug][Connector-v2][PulsarSource]Fix pulsar option topic-pattern bug. #3989
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,12 +213,11 @@ private void setPartitionDiscoverer(Config config) { | |
if (StringUtils.isNotBlank(topic)) { | ||
this.partitionDiscoverer = new TopicListDiscoverer(Arrays.asList(StringUtils.split(topic, ","))); | ||
} | ||
String topicPattern = config.getString(TOPIC_PATTERN.key()); | ||
if (StringUtils.isNotBlank(topicPattern)) { | ||
if (this.partitionDiscoverer != null) { | ||
throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' and '%s' is exclusive.", TOPIC.key(), TOPIC_PATTERN.key())); | ||
if (config.hasPath(TOPIC_PATTERN.key())) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. back to this question. #3989 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, redundancy judgment deleted. |
||
String topicPattern = config.getString(TOPIC_PATTERN.key()); | ||
if (StringUtils.isNotBlank(topicPattern)) { | ||
this.partitionDiscoverer = new TopicPatternDiscoverer(Pattern.compile(topicPattern)); | ||
} | ||
this.partitionDiscoverer = new TopicPatternDiscoverer(Pattern.compile(topicPattern)); | ||
} | ||
if (this.partitionDiscoverer == null) { | ||
throw new PulsarConnectorException(SeaTunnelAPIErrorCode.OPTION_VALIDATION_FAILED, String.format("The properties '%s' or '%s' is required.", TOPIC.key(), TOPIC_PATTERN.key())); | ||
|
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.
topic
should useconfig.hasPath(TOPIC_PATTERN.key()
judge whether there isThere 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.
done.