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

[improve][broker] Add additional configuration items to control the type of auto-creation of retry-topic and DLQ-topic #23806

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ allowAutoTopicCreation=true
# The type of topic that is allowed to be automatically created.(partitioned/non-partitioned)
allowAutoTopicCreationType=non-partitioned

# The type of retry letter topic or dead letter topic that is allowed to be automatically created.(partitioned/non-partitioned)
allowAutoRetryOrDLQTopicCreationType=non-partitioned

# If 'allowAutoTopicCreation' is true and the name of the topic contains 'cluster',
# the topic cannot be automatically created.
allowAutoTopicCreationWithLegacyNamingScheme=true
Expand Down
3 changes: 3 additions & 0 deletions conf/standalone.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,9 @@ allowAutoTopicCreation=true
# The type of topic that is allowed to be automatically created.(partitioned/non-partitioned)
allowAutoTopicCreationType=non-partitioned

# The type of retry letter topic or dead letter topic that is allowed to be automatically created.(partitioned/non-partitioned)
allowAutoRetryOrDLQTopicCreationType=non-partitioned

# If 'allowAutoTopicCreation' is true and the name of the topic contains 'cluster',
# the topic cannot be automatically created.
allowAutoTopicCreationWithLegacyNamingScheme=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,13 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
doc = "The type of topic that is allowed to be automatically created.(partitioned/non-partitioned)"
)
private TopicType allowAutoTopicCreationType = TopicType.NON_PARTITIONED;
@FieldContext(
category = CATEGORY_STORAGE_ML,
dynamic = true,
doc = "The type of retry letter topic or dead letter topic "
+ "that is allowed to be automatically created.(partitioned/non-partitioned)"
)
private TopicType allowAutoRetryOrDLQTopicCreationType = TopicType.NON_PARTITIONED;
@FieldContext(category = CATEGORY_SERVER, dynamic = true,
doc = "If 'allowAutoTopicCreation' is true and the name of the topic contains 'cluster',"
+ "the topic cannot be automatically created."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3565,7 +3565,7 @@ private CompletableFuture<Boolean> isAllowAutoTopicCreationAsync(final TopicName
public boolean isDefaultTopicTypePartitioned(final TopicName topicName, final Optional<Policies> policies) {
if (topicName.getPartitionedTopicName().endsWith(DLQ_GROUP_TOPIC_SUFFIX)
|| topicName.getPartitionedTopicName().endsWith(RETRY_GROUP_TOPIC_SUFFIX)) {
return false;
return TopicType.PARTITIONED.equals(pulsar.getConfiguration().getAllowAutoRetryOrDLQTopicCreationType());
}
AutoTopicCreationOverride autoTopicCreationOverride = getAutoTopicCreationOverride(topicName, policies);
if (autoTopicCreationOverride != null) {
Expand Down
Loading