New RunLLM response generated:
>>>*# Question*
I’m facing a problem where the consumer internal DLQ producer can’t connect due to a conflict with another producer with the same name. This issue was fixed in version 4.1.0, but it requires Java 17, which is not feasible for us at the moment (still with java8 ) I want to implement a short-term workaround to detect this issue and recreate the consumer with a different name, which, in theory, should resolve the conflict. The pulsar client implementation, however, seems to hide the entire DLQ handling, with exceptions not thrown or propagated back to external code. Is there a way to archive what I need here?
# Answer
It seems likely that the Pulsar client does not propagate DLQ producer creation exceptions to external code, making it difficult to detect and handle DLQ producer name conflicts programmatically. The DLQ handling is internal, and errors such as "Producer with name ... is already connected to topic" are logged but not thrown to the user code, as seen in the Java client implementation and related issues (
DeadLetterTopicTest.java,
ConsumerImpl.java,
GitHub Issue #21888).
My understanding is that, without upgrading to a fixed version, there is no supported way to catch these internal DLQ producer errors from user code. As a workaround, you could monitor logs for the specific error and programmatically restart the consumer with a different name, but this would be external to the Pulsar client API. Would you like more detail on how to implement such a log-based workaround or on the internal client code paths?
Sources:
-
DeadLetterTopicTest.java
-
ConsumerImpl.java
-
GitHub Issue #21888
Slack Link
https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1762384311.130299 👍 0 button 👎 0 button 💡
Hint: Mention @runllm in the thread for followups.