This commit is a follow up of https://github.com/rabbitmq/rabbitmq-server/pull/11604
This commit changes the AMQP address format v2 from
```
/e/:exchange/:routing-key
/e/:exchange
/q/:queue
```
to
```
/exchanges/:exchange/:routing-key
/exchanges/:exchange
/queues/:queue
```
Advantages:
1. more user friendly
2. matches nicely with the plural forms of HTTP API v1 and HTTP API v2
This plural form is still non-overlapping with AMQP address format v1.
Although it might feel unusual at first to send a message to `/queues/q1`,
if you think about `queues` just being a namespace or entity type, this
address format makes sense.
`rabbit_runtime_parameters:value_global/2` was only used in
`rabbit_nodes:cluster_name/0` since near the beginning of the commit
history of the server and its usage was eliminated in 06932b9fcb
(#3085, released in v3.8.17+ and v3.9.0+).
`rabbit_runtime_parameters:value/4` doesn't appear to have been ever
used since it was introduced near the beginning of the commit history.
It may have been added just to mirror `value_global/2`'s interface.
Eliminating these dead functions allows us to also eliminate a somewhat
complicated function `rabbit_db_rtparams:get_or_set/2`.
These are built on x86 runners in CPU emulation mode, which is very slow
(over an hour to build the image, instead of minutes). It'd be nice to have
these back at some point but for now - they are blocking the publication of
amd64 images
Partially copy file
https://github.com/ninenines/cowlib/blob/optimise-urldecode/src/cow_uri.erl
We use this copy because:
1. uri_string:unquote/1 is lax: It doesn't validate that characters that are
required to be percent encoded are indeed percent encoded. In RabbitMQ,
we want to enforce that proper percent encoding is done by AMQP clients.
2. uri_string:unquote/1 and cow_uri:urldecode/1 in cowlib v2.13.0 are both
slow because they allocate a new binary for the common case where no
character was percent encoded.
When a new cowlib version is released, we should make app rabbit depend on
app cowlib calling cow_uri:urldecode/1 and delete this file (rabbit_uri.erl).
to distinguish between v1 and v2 address formats.
Previously, v1 and v2 address formats overlapped and behaved differently
for example for:
```
/queue/:queue
/exchange/:exchange
```
This PR changes the v2 format to:
```
/e/:exchange/:routing-key
/e/:exchange
/q/:queue
```
to distinguish between v1 and v2 addresses.
This allows to call `rabbit_deprecated_features:is_permitted(amqp_address_v1)`
only if we know that the user requests address format v1.
Note that `rabbit_deprecated_features:is_permitted/1` should only
be called when the old feature is actually used.
Use percent encoding / decoding for address URI format v2.
This allows to use any UTF-8 encoded characters including slashes (`/`)
in routing keys, exchange names, and queue names and is more future
safe.
These changes are generated by 'make actions-workflows'. The change to
the template that causes the diff is in the parent commit - adding a
suffixed of "-mixed" to the job names.
Without the suffix it's hard to tell apart regular and mixed version
workflows by name. Currently you need to go into the "Set up job" step
or look at the bazelisk cquery. Changing the names should have no
functional change - it's just easier to tell the jobs apart in the
GitHub UI.
This commit only updates the template. The child commit will regenerate
the workflow file via 'make actions-workflows'.
This appears to be an oversight when creating the mixed version
template: the CLI should use the mixed version workflow template rather
than the regular plugin workflow.
test `confirm_nack` had a race condition that mean either ack or nack
where likely outcomes. By stopping the queue before the publish we
ensure only nack is the valid outcome.
Before, changing a file in src/ resulted in all tests being
rebuilt. We typically do not want that. Now only the relevant
files will get rebuilt. This has a huge impact on workflow:
make -C deps/rabbit test-build 22,06s user 3,24s system 119% cpu 21,169 total
make -C deps/rabbit test-build 3,56s user 1,01s system 153% cpu 2,966 total
The beam cache allows switching between app and test
builds without having to rebuild everything. Since
the files keep their mtime and other attributes,
rebuilding continues from where it was left off
before, and only the relevant files get rebuilt
if anything changed.
`rabbit_mgmt_util:internal_server_error/4` expects an atom or binary
and a string formattable term (`~ts`) as arguments but
`rabbit_mgmt_wm_vhost` passes charlists and any term. This can cause
a log formatter crash and an unexpected message in the management UI
when attempting to add a vhost while a cluster is in a minority with
Khepri enabled for example.
We can pass atoms for the `Error` parameter and binaries or strings for
the `Reason` parameter to fix both issues.