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

Default exchange in v3 documentation #1302

Open
andreleblanc11 opened this issue Nov 22, 2024 · 2 comments
Open

Default exchange in v3 documentation #1302

andreleblanc11 opened this issue Nov 22, 2024 · 2 comments
Labels
Documentation Primary deliverable of this item is documentation likely-fixed likely fix is in the repository, success not confirmed yet. v3 issue deferred to or affects version 3

Comments

@andreleblanc11
Copy link
Member

In v2, when exchange is omitted from a config it resolves to xpublic -> https://github.com/MetPX/sarracenia/blob/v2_stable/doc/sr_subscribe.1.rst#exchange-name-default-xpublic-and-exchange_suffix

In v3, the behaviour is a bit different.
But the v3 docs don't reflect this, and states that it also resolves to xpublic
https://metpx.github.io/sarracenia/Reference/sr3_options.7.html#exchange-name-default-xpublic-and-exchangesuffix

It's only when a broker user isn't specified or when the user is anonymous that xpublic is defaulted.

def _resolve_exchange(self):
"""
based on the given configuration, fill in with defaults or guesses.
sets self.exchange.
"""
if not hasattr(self, 'exchange') or self.exchange is None:
#if hasattr(self, 'post_broker') and self.post_broker is not None and self.post_broker.url is not None:
# self.exchange = 'xs_%s' % self.post_broker.url.username
#else:
if not hasattr(self.broker.url,'username') or ( self.broker.url.username == 'anonymous' ):
self.exchange = 'xpublic'
else:
self.exchange = 'xs_%s' % self.broker.url.username

@andreleblanc11 andreleblanc11 added v3 issue deferred to or affects version 3 Documentation Primary deliverable of this item is documentation labels Nov 22, 2024
@andreleblanc11 andreleblanc11 changed the title Default exchange is wrong in v3 documentation Default exchange in v3 documentation Nov 22, 2024
@petersilva
Copy link
Contributor

I remember thinking about this for a long time... I can't recall if the change of default is an intentional change or a bug... have to go rummage through old logs and docs.

obviously:

  • this arises when converting... we could have sr3 convert add an exchange directive to make the conversion result reflect the v2 intent.
  • we could change the default in sr3.

dunno which to do atm...

@andreleblanc11
Copy link
Member Author

I think what we set now makes sense. Most client will be pulling data through the anonymous user so performing an sr3 convert and omitting the exchange would still be fine.

Some other clients did specify other broker users but would still not specify the exchange in v2. I think for that case using convert to reflect v2 behavior would be the way to go.

@petersilva petersilva added the likely-fixed likely fix is in the repository, success not confirmed yet. label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Primary deliverable of this item is documentation likely-fixed likely fix is in the repository, success not confirmed yet. v3 issue deferred to or affects version 3
Projects
None yet
Development

No branches or pull requests

2 participants