<@U078Y59KC3B> why doesn't the Go pulsar `Client.S...
# ask-ai
s
@RunLLM why doesn't the Go pulsar
Client.Subscribe
method take a
context.Context
as one of the parameters?
r
The Go Pulsar
Client.Subscribe
method does not currently take a
context.Context
as a parameter, which limits the ability to control the subscription lifecycle using context-based cancellation or timeouts. This has been a topic of discussion in the community, as seen in various issues and pull requests. For example, there are requests to add context control to various methods in the Pulsar Go client to improve observability and manage long-running operations more effectively (GitHub Issue 1147, GitHub Issue 803). Would you like more detail on the ongoing discussions or potential workarounds? Sources: - GitHub Issue 1147 - GitHub Issue 803 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM is it safe to call
Client.Subscribe
with a subscription that does not exist? Will it create the subscription in that case?
r
Yes, it is safe to call
Client.Subscribe
with a subscription that does not exist. If the subscription does not exist, Pulsar will automatically create a new subscription for you. This behavior is consistent across different Pulsar clients, including the Go client. When you subscribe to a topic with a new subscription name, Pulsar creates the subscription at the end of the topic by default, retaining all messages published after the subscription is created until they are acknowledged (Pulsar Go Client Documentation). Would you like more detail on how subscriptions are managed in Pulsar? Sources: - Pulsar Go Client Documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM For creating a subscription, does the topic need to exist? Would I also need to create the topic used for retry if retries are enabled?
r
For creating a subscription in Apache Pulsar, the topic does not need to pre-exist if the
allowAutoTopicCreation
setting is enabled. Pulsar can automatically create the topic when a subscription is created or when a message is published to it (Pulsar Documentation). Regarding retry topics, if retries are enabled, Pulsar will automatically create a retry letter topic if it does not already exist. The retry letter topic is used to store messages that need to be retried, and it follows a specific naming convention based on the original topic and subscription name (Retry Letter Topic Documentation). Would you like more detail on how these topics are managed or configured? Sources: - Pulsar Documentation - Retry Letter Topic Documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM will the retry topic be created automatically even if
allowAutoTopicCreation
is disabled?
r
No, if
allowAutoTopicCreation
is disabled, the retry topic will not be created automatically. The
allowAutoTopicCreation
setting controls whether topics can be automatically created when they do not exist. If this setting is disabled, any attempt to use a retry topic that does not already exist will result in an error, as the topic will not be automatically created by Pulsar (GitHub Issue 9021e0a0). Would you like more detail on configuring topic creation settings in Pulsar? Sources: - GitHub Issue 9021e0a0 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.