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

Add new option [messaging].prefix to configure prefix of RabbitMQ exchange/queue names #6282

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Nov 23, 2024

  1. messaging: Make exchange/queue name prefix configurable

    This, adds a new messaging.prefix option that gets modified
    to include the test slot as needed.
    
    Exchanges are defined as module level vars initialized on import.
    But, oslo_config is not setup yet at import time, so delay applying the
    new prefix setting until just before they get created in RabbitMQ.
    
    Luckily, Exchange() objects are lightweight objects that just
    hold the exchange name and type. They could do more, but we
    don't bind them to a channel. Because the exchange objects
    merely hold strings, and because they are basically singletons
    (module-level vars), we can safely update the exchange name
    just before declaring it in RabbitMQ. From that point on,
    everything that uses a singleton exchange object will get
    the updated name.
    cognifloyd committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    8be6838 View commit details
    Browse the repository at this point in the history
  2. stream: use well known st2. prefix in event names

    Now that the exchange name prefix is configurable, we have
    to undo the prefix to maintain a backwards compatible API.
    Also, having the event names vary based on config would be
    a very bad UX, so we don't want to go there anyway.
    cognifloyd committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    921416e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c7c4263 View commit details
    Browse the repository at this point in the history
  4. Use Producer.auto_declare to declare exchanges as needed

    Connection has a cache of which entities (exchange/queue)
    have been declared, so this shouldn't have too much of a
    performance impact. This does, however, make tests much more
    reliable.
    cognifloyd committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    ac9bcbd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3ca0b03 View commit details
    Browse the repository at this point in the history
  6. add changelog entry

    cognifloyd committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    b6d23c9 View commit details
    Browse the repository at this point in the history