Skip to content
Merged
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ private boolean sendRecords() {
continue;
}

log.trace("{} Appending record with key {}, value {}", this, record.key(), record.value());
log.trace("{} Appending record to the topic {} with key {}, value {}", this, record.topic(), record.key(), record.value());
// We need this queued first since the callback could happen immediately (even synchronously in some cases).
// Because of this we need to be careful about handling retries -- we always save the previously attempted
// record as part of toSend and need to use a flag to track whether we should actually add it to the outstanding
Expand Down Expand Up @@ -409,6 +409,9 @@ private boolean sendRecords() {
// RegexRouter) topic creation can not be batched for multiple topics
private void maybeCreateTopic(String topic) {
if (!topicCreation.isTopicCreationRequired(topic)) {
log.trace("The topic creation setting is disabled or the topic name {} is already in the topic cache." +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is going to be very repetitive after the first time during which the topic might be created.

What's the hint we are trying to extract here?

@showuon showuon Sep 21, 2020

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@kkonstantine , thanks for the comment, what I'm trying to do here is to let the user know if the creating topic pending for a long time without response (default timeout is 30 or 60 secs), we let user know earlier that this situation might happen, and it could because the auto.create.topics.enable is disabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
log.trace("The topic creation setting is disabled or the topic name {} is already in the topic cache." +
log.trace("Topic creation by the connector is disabled or the topic {} was previously created." +

"If the topic doesn't exist, we'll rely on the auto.create.topics.enable setting in broker side " +
"to see if the topic can be auto created or not", topic);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"If the topic doesn't exist, we'll rely on the auto.create.topics.enable setting in broker side " +
"to see if the topic can be auto created or not", topic);
"If auto.create.topics.enable is enabled on the broker, the topic will be created with " +
"default settings", topic);

return;
}
log.info("The task will send records to topic '{}' for the first time. Checking "
Expand All @@ -430,7 +433,7 @@ private void maybeCreateTopic(String topic) {
log.info("Created topic '{}' using creation group {}", newTopic, topicGroup);
} else {
log.warn("Request to create new topic '{}' failed", topic);
throw new ConnectException("Task failed to create new topic " + topic + ". Ensure "
throw new ConnectException("Task failed to create new topic " + newTopic + ". Ensure "

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

should be newTopic here for error message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are referring to the inclusion of topic properties besides the topic name. Yeah that's fine.

+ "that the task is authorized to create topics or that the topic exists and "
+ "restart the task");
}
Expand Down