Skip to content

Conversation

therepanic
Copy link
Contributor

I chose PulsarListenerAnnotationBeanPostProcessor because I think it's easier to inject PulsarTopicBuilder into it, which I think is better than passing it to MethodPulsarListenerEndpoint later.

Closes: gh-1241

@onobc
Copy link
Collaborator

onobc commented Sep 15, 2025

Sorry it has taken me this long to get back to this PR @therepanic .

So digging into the details during PR review it made me realize that we can do this in a much simpler fashion than I originally hinted towards in the PR description.

Since the DLT feature is only available for consumers AND we are already ensuring FQ topic names in org.springframework.pulsar.core.DefaultPulsarConsumerFactory#ensureTopicNamesFullyQualified we can simply add code here to do the same treatment for consumerBuilder#deadLetterPolicy.deadLetterTopicName.

Something like:

if (builderImpl.getConf().getDeadLetterPolicy() != null) {
	var dlt = builderImpl.getConf().getDeadLetterPolicy().getDeadLetterTopic();
	if (dlt != null) {
		builderImpl.getConf().getDeadLetterPolicy().setDeadLetterTopic(
				this.topicBuilder.getFullyQualifiedNameForTopic(dlt));
	}
}

Also, we should do the same treatment for the DeadLetterPolicy#retryLetterTopic.

Wdyt?

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.

Allow DeadLetterPolicy.deadLetterTopic to be non-fully-qualified
2 participants