-
Notifications
You must be signed in to change notification settings - Fork 19
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
[events] Support ephemeral consumers #184
[events] Support ephemeral consumers #184
Conversation
Signed-off-by: Matt Siwiec <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a minute since I touched the NATS bits but looking through this and the NATS godocs this looks good to me. I'll leave it unmerged for now so anyone else from sig-events can review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than this small change, this looks good.
events/nats_config.go
Outdated
@@ -55,7 +55,11 @@ type NATSConfig struct { | |||
|
|||
// Configured checks whether the provider has been configured. | |||
func (c NATSConfig) Configured() bool { | |||
return c.URL != "" || c.QueueGroup != "" | |||
if c.QueueGroup == "" { | |||
c.logger.Warn("NATS QueueGroup is not set. Subscriptions will not be durable.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning should go in NewNATSConnection
function. This method is to determine whether this config has a configuration defined.
Signed-off-by: Matt Siwiec <[email protected]>
loadbalancer-manager-haproxy does not have a need for durable message queues, as we want each instance to consume all messages received related to loadbalancers.
Currently, we generate a unique durable queue for each manager instance, which eventually puts strain on nats with the number of consumers that can be generated over time. This PR aims to put support for ephemeral consumers back into event subscriptions, if requested, by leaving
QueueGroup
empty in the nats config.