jordanfitz commented on code in PR #1456:
URL: https://github.com/apache/pulsar-client-go/pull/1456#discussion_r2699162908


##########
pulsar/consumer_regex.go:
##########
@@ -454,6 +481,11 @@ func (c *regexConsumer) topics() ([]string, error) {
        }
 
        filtered := filterTopics(topics, c.pattern)
+
+       if c.options.RetryEnable && c.options.DLQ != nil {
+               filtered = append(filtered, c.options.DLQ.RetryLetterTopic)

Review Comment:
   Gotcha. I think my confusion stems from my impression that the logic in 
`topics()` is each time producing a new slice of topics in the namespace (via 
its call to `GetTopicsOfNamespace`), to which the RLQ topic is appended 
afterward. So two calls to `topics()` _should_ result in two different slices, 
each with one RLQ topic, unless I'm mistaken. Maybe it's possible for the regex 
to match the RLQ topic, in which case, it would end up in the slice more than 
once. I think the defensive check is definitely a good option! 😄 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to