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

[Issue 1297][consumer] Fix DLQ producer name conflicts when there are same name consumers #1314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

geniusjoe
Copy link
Contributor

Fixes #1297
Master Issue: apache/pulsar#21589

Motivation

When multiple consumers with same name are using dlq policies at the same time, prompt will throw below exceptions:
ERRO[0069] Failed to create DLQ producer dlq-topic="persistent://<tenant>/<namespace>/<topic>-<subscription>-DLQ" error="server error: ProducerBusy: org.apache.pulsar.broker.service.BrokerServiceException$NamingException: Producer with name '-<subscription>-<consumerName>-DLQ' is already connected to topic"

Modifications

Add a random suffix in dlq producer name like: opt.Name = fmt.Sprintf("%s-%s-%s-%s-DLQ", r.topicName, r.subscriptionName, r.consumerName, generateRandomName())

Verifying this change

  • Make sure that the change passes the CI checks.
    This change is already covered by existing tests, such as pulsar/consumer_test.go#TestDLQ(t *testing.T)

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)
    I will create a followup issue for adding the documentation later.

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.

[Bug] DLQ producer name conflicts when same name consumer sends messages to DLQ
1 participant