Commit Graph

30979 Commits

Author SHA1 Message Date
Michael Davis 5a32322778
rabbit_mgmt_gc: Switch from `gb_sets` to `sets` v2
`sets` v2 were not yet available when this module was written. Compared
to `gb_sets`, v2 `sets` are faster and more memory efficient:

    > List = lists:seq(1, 50_000).
    > tprof:profile(sets, from_list, [List, [{version, 2}]], #{type => call_memory}).

    ****** Process <0.94.0>  --  100.00% of total ***
    FUNCTION          CALLS   WORDS   PER CALL  [     %]
    maps:from_keys/2      1  184335  184335.00  [100.00]
                             184335             [ 100.0]
    ok
    > tprof:profile(gb_sets, from_list, [List], #{type => call_memory}).

    ****** Process <0.97.0>  --  100.00% of total ***
    FUNCTION                  CALLS   WORDS   PER CALL  [    %]
    lists:rumergel/3              1       2       2.00  [ 0.00]
    gb_sets:from_ordset/1         1       3       3.00  [ 0.00]
    lists:reverse/2               1  100000  100000.00  [16.76]
    lists:usplit_1/5          49999  100002       2.00  [16.76]
    gb_sets:balance_list_1/2  65535  396605       6.05  [66.48]
                                     596612             [100.0]
2025-05-16 14:23:24 -04:00
Michael Davis ce5d42a9d6
Hibernate after collecting garbage in `rabbit_mgmt_gc`
The `rabbit_mgmt_gc` gen_server performs garbage collections
periodically. When doing so it can create potentially fairly large
terms, for example by creating a set out of
`rabbit_exchange:list_names/0`. With many exchanges, for example, the
process memory usage can climb steadily especially when the management
agent is mostly idle since `rabbit_mgmt_gc` won't hit enough reductions
to cause a full-sweep GC on itself. Since the process is only active
periodically (once every 2min by default) we can hibernate it to GC the
terms it created.

This can save a medium amount of memory in situations where there are
very many pieces of metadata (exchanges, vhosts, queues, etc.). For
example on an idle single-node broker with 50k exchanges,
`rabbit_mgmt_gc` can hover around 50MB before being naturally GC'd. With
this patch the process memory usage stays consistent between `start_gc`
timer messages at around 1KB.
2025-05-16 14:16:58 -04:00
Michael Davis 314e4261fc
minor: Avoid flake in `rabbit_mgmt_http_health_checks_SUITE`
The `below_node_connection_limit_test` and `ready_to_serve_clients_test`
cases could possibly flake because `is_quorum_critical_single_node_test`
uses the channel manager in `rabbit_ct_client_helpers` to open a
connection. This can cause the line

     true = lists:all(fun(E) -> is_pid(E) end, Connections),

to fail to match. The last connection could have been rejected if the
channel manager kept its connection open, so instead of being a pid the
element would have been `{error, not_allowed}`.

With `rabbit_ct_client_helpers:close_channels_and_connection/2` we can
reset the connection manager and force it to close its connection.
2025-05-13 10:50:14 -04:00
Michael Davis 3f53e0172d
Remove connection counts and limits from public API health checks
Returning the connection limit and active count are not really necessary
for these checks. Instead of returning them in the response to the
health check we log a warning when the connection limit is exceeded.
2025-05-12 19:59:25 -04:00
dependabot[bot] 2365b94f98
[skip ci] Bump com.google.googlejavaformat:google-java-format
Bumps the dev-deps group with 1 update in the /deps/rabbit/test/amqp_jms_SUITE_data directory: [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format).


Updates `com.google.googlejavaformat:google-java-format` from 1.26.0 to 1.27.0
- [Release notes](https://github.com/google/google-java-format/releases)
- [Commits](https://github.com/google/google-java-format/compare/v1.26.0...v1.27.0)

---
updated-dependencies:
- dependency-name: com.google.googlejavaformat:google-java-format
  dependency-version: 1.27.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-10 18:16:48 +00:00
Michael Davis 67bdc011cb
Add a health check for testing readiness to serve clients 2025-05-09 11:36:07 -04:00
Michael Davis 028b69213e
Add a health check for testing the node connection limit 2025-05-09 11:28:11 -04:00
Michael Klishin a4afc2a44a
Merge pull request #13872 from rabbitmq/md/health-check-is-in-service
Add an 'is-in-service' health check wrapping `rabbit:is_serving/0`
2025-05-08 21:42:27 +04:00
Michael Davis 07fe6307c6
Add an 'is-in-service' health check wrapping `rabbit:is_serving/0`
This is useful for a load balancer, for example, to be able to avoid
sending new connections to a node which is running and has listeners
bound to TCP ports but is being drained for maintenance.
2025-05-08 11:11:52 -04:00
Michael Davis 5d319be3f9
Accept multiple protocols in protocol listener health check
This updates the health check for protocol listeners to accept a set of
protocols, comma-separated. The check only returns 200 OK when all
requested protocols have active listeners.
2025-05-08 11:01:59 -04:00
Michael Davis 0d692fa161
Prefer node-local listeners helper in protocol-listener health check
This is a minor change that avoids a cluster-wide query for active
listeners. The old code called `rabbit_networking:active_listeners/0`
and then filtered the results by ones available on the local node. This
caused an RPC and concatenation of all other cluster members' listeners
and then in the next line filtered down to local nodes. Equivalently we
can use `rabbit_networking:node_listeners(node())` which dumps a local
ETS table.

This is not a very impactful change but it's nice to keep the latency of
the health-check handlers low and reduce some unnecessary cluster noise.
2025-05-08 10:43:33 -04:00
Michael Klishin d27d5c48ce
Merge pull request #13856 from cloudamqp/faster_empty_cq_init
Make empty CQ init faster in case of clean shutdown
2025-05-08 18:24:28 +04:00
Michael Klishin f50a8d39cc
Merge pull request #13861 from rabbitmq/move-os_mon-users-back-to-rabbit
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.17, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.17, 27) (push) Waiting to run Details
Test (make) / Test (1.17, 27, khepri) (push) Waiting to run Details
Test (make) / Test (1.17, 27, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.17, 27, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.17, 27, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.17, 27) (push) Waiting to run Details
Test Management UI with Selenium / selenium (chrome, 1.17.3, 27.3) (push) Waiting to run Details
Move `file_handle_cache` and `vm_memory_monitor` back to `rabbit`
2025-05-07 21:59:22 +04:00
Péter Gömöri 150172f008 Make empty CQ init faster in case of clean shutdown
At CQ startup variable_queue went through each seqid from 0 to
next_seq_id looking for the first message even if there were no
messages in the queue (no segment files).

In case of a clean shutdown the value next_seq_id is stored in
recovery terms. This value can be utilized by the queue index to
provide better seqid bounds in absence of segment files.

Before this patch starting an empty classic queue with next_seq_id =
100_000_000 used to take about 26 seconds. With this patch it takes
less than 1ms.
2025-05-07 14:59:46 +02:00
David Ansari cddfe3ba41 Removed unused function 2025-05-07 14:52:02 +02:00
Jean-Sébastien Pédron e58eb1807a
Move `file_handle_cache` and `vm_memory_monitor` back to `rabbit`
[Why]
They were moved from `rabbit` to `rabbit_common` several years ago to
solve an dependency issue because `amqp_client` depended on the file
handle cache. This is not the case anymore.

[How]
The modules are moved back to `rabbit`.

`rabbit_common` doesn't need to depend on `os_mon` anymore. `rabbit`
already depends on it, so no changes needed here.

`include/rabbit_memory.hrl` and some test cases are moved as well to
follow the `vm_memory_monitor` module.
2025-05-07 09:46:14 +02:00
Arnaud Cogoluègnes 8cc26c4acd
Merge pull request #13857 from rabbitmq/stream-coordinator-fix-partition-index-conflict
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.17, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.17, 27) (push) Waiting to run Details
Test (make) / Test (1.17, 27, khepri) (push) Waiting to run Details
Test (make) / Test (1.17, 27, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.17, 27, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.17, 27, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.17, 27) (push) Waiting to run Details
Fix partition index conflict in stream SAC coordinator
2025-05-06 15:16:25 +00:00
Arnaud Cogoluègnes cad8b70ee8
Fix partition index conflict in stream SAC coordinator
Consumers with a same name, consuming from the same stream should have
the same partition index. This commit adds a check to enforce this rule
and make the subscription fail if it does not comply.

Fixes #13835
2025-05-06 16:11:46 +02:00
Iliia Khaprov 0ec25997b6
STOMP: confirm utf-8 handling 2025-05-06 13:51:37 +02:00
Michael Klishin 99a9237abb
Merge pull request #13850 from rabbitmq/ik-stomp-evergreen
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Waiting to run Details
Test (make) / Build and Xref (1.17, 26) (push) Waiting to run Details
Test (make) / Build and Xref (1.17, 27) (push) Waiting to run Details
Test (make) / Test (1.17, 27, khepri) (push) Waiting to run Details
Test (make) / Test (1.17, 27, mnesia) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.17, 27, khepri) (push) Waiting to run Details
Test (make) / Test mixed clusters (1.17, 27, mnesia) (push) Waiting to run Details
Test (make) / Type check (1.17, 27) (push) Waiting to run Details
Test Authentication/Authorization backends via mutiple messaging protocols / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled Details
Test Authentication/Authorization backends via mutiple messaging protocols / summary-selenium (push) Has been cancelled Details
Test Management UI with Selenium / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled Details
STOMP: queue type tests - add queue.type assertions
2025-05-05 21:31:53 +04:00
Michael Klishin 53f511fa15
Merge pull request #13837 from rabbitmq/dqt-export-fix
Modify default queue type injection logic
2025-05-05 21:20:24 +04:00
Michael Klishin 451850f325
Merge pull request #13836 from rabbitmq/super-streams-ui
Management UI: new page and elements for superstreams (partitioned streams)
2025-05-05 20:34:04 +04:00
Iliia Khaprov a91371dfe6
STOMP: queue type tests - add queue.type assertions 2025-05-05 11:42:39 +02:00
Diana Parra Corbacho ef09b190ce Mgmt UI: Add super streams page 2025-05-04 19:53:55 +02:00
Michael Klishin 8cbd7e6243
Merge pull request #13838 from rabbitmq/selenium-select-columns-for-virtualhosts
Test Management UI with Selenium / selenium (chrome, 1.17.3, 27.3) (push) Waiting to run Details
Trigger a 4.2.x alpha release build / trigger_alpha_build (push) Has been cancelled Details
Test Authentication/Authorization backends via mutiple messaging protocols / selenium (chrome, 1.17.3, 27.3) (push) Has been cancelled Details
Test (make) / Build and Xref (1.17, 26) (push) Has been cancelled Details
Test (make) / Build and Xref (1.17, 27) (push) Has been cancelled Details
Test (make) / Test (1.17, 27, khepri) (push) Has been cancelled Details
Test (make) / Test (1.17, 27, mnesia) (push) Has been cancelled Details
Test (make) / Test mixed clusters (1.17, 27, khepri) (push) Has been cancelled Details
Test (make) / Test mixed clusters (1.17, 27, mnesia) (push) Has been cancelled Details
Test (make) / Type check (1.17, 27) (push) Has been cancelled Details
Test Authentication/Authorization backends via mutiple messaging protocols / summary-selenium (push) Has been cancelled Details
Test management ui selection of vhost's tags columns
2025-05-02 18:35:14 +04:00
Michal Kuratczyk 435274bc83
Fix formatter crash in rabbit_reader 2025-05-02 14:56:07 +02:00
Michal Kuratczyk f61b9d9bf4
Add a test for DQT upon vhost creation 2025-05-02 14:01:10 +02:00
Michal Kuratczyk 9bd11b449f
Set the DQT in rabbit_vhost:do_add 2025-05-02 13:58:00 +02:00
Marcial Rosales 7003fefa44 Select columns of vhosts 2025-05-02 13:05:25 +02:00
Michal Kuratczyk 9d0f01b45b
Add DQT to vhost metadata on recovery
Vhosts that currently don't have their own default queue type, now
inherit it from the node configuration and store it in their metadata
going forward.
2025-05-01 17:28:32 +02:00
Michal Kuratczyk 0e743b5fe7
Adjust tests to the new behaviour 2025-05-01 17:28:32 +02:00
Michal Kuratczyk 3c95bf32e7
vhost inherits DQT from node
Rather than injecting node-level DQT when exporting definitions,
inject it into vhost's metadata when a vhost is created.
2025-05-01 17:28:32 +02:00
Michal Kuratczyk 5eb65f5f72
Remove vhost.default_queue_type from HTTP defs export 2025-05-01 17:28:32 +02:00
Michal Kuratczyk 73da2a3fbb
Fix DQT in definition export (redundant property)
The correct place for the `default_queue_type` property
is inside the `metadata` block. However, right now we'd
always export the value outside of `metadata` AND only
export it inside `metadata`, if it was not `undefined`.

This value outside of `metadata` was just misleading:
if a user exported the definitins from a fresh node,
changed `classic` to `quorum` and imported such modified
values, the DQT would still be `classic`, because RMQ looks
for the value inside `metadata`. Just to make it more confusing,
if the DQT was changed successfully one way or another, the
value outside of `metadata` would reflect that
(it always shows the correct value, but is ignored on import).
2025-05-01 17:28:32 +02:00
Marcial Rosales 01ca72edc0 Test adding vhost 2025-04-30 18:08:58 +02:00
Michael Klishin 467601a62d
Merge pull request #13822 from rabbitmq/lukebakken/delete-unused-js
Remove unused Javascript functions
2025-04-29 03:09:10 +04:00
Luke Bakken 61b0f152fd
Remove unused Javascript functions
A security scanner flagged the use of `RegExp` with unsanitized input.
Turns out, these functions are no longer used and can be deleted.
2025-04-28 12:18:06 -07:00
Michal Kuratczyk 0f36610e9d
Don't log a crash on connection termination 2025-04-28 15:39:13 +02:00
Michal Kuratczyk 0ce6ad0f0f
Add a `flush` handler to amqp_channel
rabbit_channel may use amqp_channel as the writer.
When terminating, rabbit_channel sends a `flush` message
to its writer. If amqp_channel is in use, that led to
a `function_clause` crash.
2025-04-28 15:39:02 +02:00
Michal Kuratczyk 0ec41c6c41
Shovel: de-flake dynamic_SUITE
checking that not a single process has a message in the mailbox
is prone to flakes.
2025-04-28 14:05:27 +02:00
Michael Klishin 164d495dfc
Merge pull request #13818 from rabbitmq/rabbitmq-server-13767
By @aaron-seo: Adds a new auth backend that only accepts loopback connections
2025-04-27 12:58:02 +04:00
Aaron Seo 85e14c74fa
Filter out sockOrAddr from http auth backend's request query
(cherry picked from commit 844f25d77a)
2025-04-27 04:04:20 -04:00
Michael Klishin c9b2b7fb22
Naming #13809 2025-04-26 18:40:50 -04:00
Razvan Grigore 09c546a1c8
Add Socket SSL column to management UI 2025-04-26 18:40:50 -04:00
Michael Klishin 55dc63a801
Merge pull request #13817 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot/main/prod-deps-ad66588521
[skip ci] Bump the prod-deps group across 2 directories with 1 update
2025-04-26 23:55:20 +04:00
dependabot[bot] 47e65df77d
[skip ci] Bump the prod-deps group across 2 directories with 1 update
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot directory: [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot_kotlin directory: [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot).


Updates `org.springframework.boot:spring-boot-starter-parent` from 3.4.4 to 3.4.5
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.4...v3.4.5)

Updates `org.springframework.boot:spring-boot-starter-parent` from 3.4.4 to 3.4.5
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.4...v3.4.5)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-version: 3.4.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-version: 3.4.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-26 18:59:25 +00:00
dependabot[bot] 1a6f603254
[skip ci] Bump com.google.code.gson:gson
Bumps the dev-deps group with 1 update in the /deps/rabbitmq_stream_management/test/http_SUITE_data directory: [com.google.code.gson:gson](https://github.com/google/gson).


Updates `com.google.code.gson:gson` from 2.13.0 to 2.13.1
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.13.0...gson-parent-2.13.1)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-version: 2.13.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-26 18:58:40 +00:00
Michael Klishin 8bf8c2e688
Merge pull request #13787 from rabbitmq/add-id-tag-to-some-management-ui-pages
Add queues and streams page and test suite
2025-04-25 23:26:53 +04:00
Michael Klishin 1806a45461
Merge pull request #13798 from rabbitmq/amqp091-to-amqp10-shovel-bug
Fix amqp091->amqp10 shovel with complex headers
2025-04-25 21:19:29 +04:00
Marcial Rosales 0cb63bb544 Add queues and streams page and test suite 2025-04-25 17:04:40 +02:00
Michal Kuratczyk c5271ea602
Some AMQP 0.9.1 headers, in particular x-death headers, cannot be set as
application properties. Before this change, trying to shovel
dead-lettered messages from an AMQP 0.9.1 source to AMQP 1.0 destination
would fail with:
```
reason: {badarg,
            [{unicode,characters_to_binary,
                 [[{table,
                       [{<<"count">>,long,1},
                        {<<"reason">>,longstr,<<"maxlen">>},
                        {<<"queue">>,longstr,<<"tmp">>},
                        {<<"time">>,timestamp,1745575728},
                        {<<"exchange">>,longstr,<<>>},
                        {<<"routing-keys">>,array,
                         [{longstr,<<"tmp">>}]}]}]],
                 [{file,"unicode.erl"},
                  {line,1219},
                  {error_info,#{module => erl_stdlib_errors}}]},
             {amqp10_client_types,utf8,1,
                 [{file,"amqp10_client_types.erl"},{line,99}]},
             {amqp10_msg,'-set_application_properties/2-fun-0-',3,
                 [{file,"amqp10_msg.erl"},{line,385}]},
             {maps,fold_1,4,[{file,"maps.erl"},{line,860}]},
             {amqp10_msg,set_application_properties,2,
                 [{file,"amqp10_msg.erl"},{line,384}]},
             {maps,fold_1,4,[{file,"maps.erl"},{line,860}]},
             {rabbit_amqp10_shovel,forward,4,
                 [{file,"rabbit_amqp10_shovel.erl"},{line,337}]},
             {rabbit_shovel_worker,handle_info,2,
                 [{file,"rabbit_shovel_worker.erl"},{line,104}]}]}
```
2025-04-25 15:46:45 +02:00
Aaron Seo 3bcdc0f359
Fallback to original implementation of plain auth_mechanism if socket is not provided 2025-04-24 13:41:57 -07:00
Jean-Sébastien Pédron 5300076e33
Khepri: Clean up the proxy functions of the integration code
[Why]
The `rabbit_khepri` module grew during the work to add Khepri support to
RabbitMQ and while Khepri was itself written. The current code is
therefore unorganized.

[How]
This commit tries to change proxy functions to be close to their Khepri
equivalent.

The module continues to set non-default options for write functions. We
also add the variants that take an option map to be consistent and not
have to deal with that in the future.

Several legacy functions were removed, either because they were no
longer called or because they were replace by a regular Khepri call.
2025-04-24 16:06:20 +02:00
Jean-Sébastien Pédron bd3aee35b4
Khepri: Clean up the setup/clustering code of the integration code
[Why]
The `rabbit_khepri` module grew during the work to add Khepri support to
RabbitMQ and while Khepri was itself written. The current code is
therefore unorganized.

[How]
This commit tries to sort the code that manages the setup of Khepri and
the functions tha deal with the Khepri cluster. It also groups functions
which provide support for CLI commands.

It also adds documentation to several functions.

Finally, when a node joins a cluster, we stop displaying the content of
the Khepri tree.
2025-04-24 11:57:51 +02:00
David Ansari 77e73deede Intercept outgoing just before conversion
Intercept outgoing message just before conversion to target protocol as
this will give most flexibility to 3rd party plugins.
2025-04-23 14:01:42 +02:00
David Ansari a24ba55d45 Store message interceptor context in MQTT proc state
It's a tradeoff between building the map for each incoming and outgoing
message (now that there are also outgoing interceptors) vs increased
memory usage for the MQTT proc state.

Connecting with MQTT 5.0 and client ID "xxxxxxxx", the number of words
are 201 before this commit vs 235 after this commit as determined by:
```
S = sys:get_state(MQTTConnectionPid),
erts_debug:size(S).
```
Therefore, this commit requires 34 word * 8 bytes = 272 bytes more per MQTT
connection, that is 272 MB more for 1,000,000 MQTT connections.
2025-04-23 14:01:42 +02:00
David Ansari 21bd300d61 Support outgoing message interceptors 2025-04-23 14:01:42 +02:00
David Ansari 6ade94f50b Improve message interceptors
1. Force the config for timestamp and routing node message interceptors
   to be configured with the overwrite boolean() to avoid defining
   multiple default values throughout the code.
2. Add type specs
3. Extend existing test case for new MQTT client ID interceptor
4. routing node and timestamp should only set the annotation for
   incoming_message_interceptors group
5. Fix `rabbitmq.conf`.
   Prior to this commit there were several issue:
   a.) Setting the right configuration was too user unfriendly, e.g. the user has to set
   ```
   message_interceptor.incoming.rabbit_mqtt_message_interceptor_client_id.annotation_key = x-opt-mqtt-client-id
   ```
   just to enable the MQTT message interceptor.
   b.) The code that parses was too difficult to understand
   c.) MQTT plugin was setting the env for app rabbit, which is an anti-pattern
   d.) disabling a plugin (e.g. MQTT), left its message interceptors still in place
   This is now all fixed, the user sets the rabbitmq.conf as follows:
   ```
   message_interceptors.incoming.set_header_timestamp.overwrite = true
   message_interceptors.incoming.set_header_routing_node.overwrite = false
   mqtt.message_interceptors.incoming.set_client_id_annotation.enabled = true
   ```
   Note that the first two lines use the same format as for RabbitMQ 4.0
   for backwards compatiblity. The last line (MQTT) follows a similar
   pattern.
2025-04-23 14:01:42 +02:00
Lois Soto Lopez 9936b8de69 Add incoming message interceptors
This commit enables users to provide custom message interceptor modules,
i.e. modules to process incoming and outgoing messages. The
`rabbit_message_interceptor` behaviour defines a `intercept/4` callback,
for those modules to implement.

Co-authored-by: Péter Gömöri <gomoripeti@users.noreply.github.com>
2025-04-23 14:01:42 +02:00
Jean-Sébastien Pédron a34ce08f8f
rabbitmq_cli: Adapt `force_reset_command_test.exs` testsuites
[Why]
`force_reset` is unsupported with Khepri.
2025-04-23 11:34:37 +02:00
Jean-Sébastien Pédron 0541996b30
rabbitmq_4_0_deprecations_SUITE: Add more assertions to ram node tests 2025-04-23 11:34:36 +02:00
Jean-Sébastien Pédron a528a415d3
Khepri: Mark `khepri_db` as stable
[Why]
The intent is to have it stable and enabled by default for new
deployment in RabbitMQ 4.1.x.

To prepare for this goal, it is time to mark the feature flag as stable
to let us iron out the library and its integration into RabbitMQ.

This is not a commitment at this stage: we will revisit this near the
beginning of the release cycle and commit to it or revert to
experimental.
2025-04-23 11:34:32 +02:00
Aaron Seo 614ce25cc7
Add test suite for rabbitmq_auth_backend_internal_loopback 2025-04-21 12:11:36 -07:00
Loïc Hoguin 7138e8a0cc
CQ: Fix rare eof crash of message store with fanout 2025-04-18 13:50:57 +02:00
Michal Kuratczyk c0368a0d24
[skip ci] Update dashboards for RabbitMQ 4.1
Key changes:
- endpoint variable to handle scraping multiple endpoints
- message size panels (new metric in 4.1)
- panels at the top of the Overview dashboard should be more up to date
  (they show the latest value)
- values should be accurate if multiple endpoints are scraped
  (previously, many would be doubled)
- Nodes table shows fewer volumns and shows node uptime
2025-04-16 17:48:21 +02:00
Michael Klishin 596e3ef41a
Cosmetics 2025-04-15 00:57:39 -04:00
Aaron Seo 803cd3956b
Fix doc typo for internal_loopback auth backend 2025-04-14 11:02:49 -07:00
Michael Klishin 228cbf9776
Naming, docs #13747 2025-04-14 08:38:03 -04:00
Anh Nguyen e557ab37a3 Add quorum queue config in INI style 2025-04-14 18:55:09 +07:00
Michael Klishin 1aa3342590
Merge pull request #13739 from rabbitmq/dependabot/maven/deps/rabbit/test/amqp_jms_SUITE_data/main/dev-deps-2c123be8b9
[skip ci] Bump the dev-deps group across 5 directories with 4 updates
2025-04-13 00:20:54 +04:00
dependabot[bot] 578552e765
[skip ci] Bump the prod-deps group across 4 directories with 1 update
Bumps the prod-deps group with 1 update in the /deps/rabbit/test/amqp_jms_SUITE_data directory: [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_mqtt/test/java_SUITE_data directory: [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data directory: [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_stream_management/test/http_SUITE_data directory: [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless).


Updates `com.diffplug.spotless:spotless-maven-plugin` from 2.44.3 to 2.44.4
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.3...maven/2.44.4)

Updates `com.diffplug.spotless:spotless-maven-plugin` from 2.44.3 to 2.44.4
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.3...maven/2.44.4)

Updates `com.diffplug.spotless:spotless-maven-plugin` from 2.44.3 to 2.44.4
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.3...maven/2.44.4)

Updates `com.diffplug.spotless:spotless-maven-plugin` from 2.44.3 to 2.44.4
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.3...maven/2.44.4)

---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-version: 2.44.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-version: 2.44.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-version: 2.44.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-version: 2.44.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-12 18:22:42 +00:00
dependabot[bot] dee14f21a3
[skip ci] Bump the dev-deps group across 5 directories with 4 updates
Bumps the dev-deps group with 1 update in the /deps/rabbit/test/amqp_jms_SUITE_data directory: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 1 update in the /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot directory: [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 1 update in the /deps/rabbitmq_mqtt/test/java_SUITE_data directory: [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 2 updates in the /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data directory: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) and [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5).
Bumps the dev-deps group with 3 updates in the /deps/rabbitmq_stream_management/test/http_SUITE_data directory: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5), [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) and [com.google.code.gson:gson](https://github.com/google/gson).


Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.12.1 to 5.12.2
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2)

Updates `com.google.code.gson:gson` from 2.12.1 to 2.13.0
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.12.1...gson-parent-2.13.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-version: 5.12.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-deps
- dependency-name: com.google.code.gson:gson
  dependency-version: 2.13.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-12 18:21:52 +00:00
Michal Kuratczyk 589e0b578c
Remove log level tests (#13723)
When debug logging is enabled, we log something at each log level
to test if logs are emitted. I don't think this is particularly useful,
but it's certainly annoying, because I constatnly need to filter
out these logs when searching if any errors happened during tests.
2025-04-11 12:13:06 +02:00
David Ansari 6eb1f87e14
Fix concurrent AMQP queue declarations (#13727)
* Fix concurrent AMQP queue declarations

Prior to this commit, when AMQP clients declared the same queues
concurrently, the following crash occurred:
```
  │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>,
  │            {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}},
  │                  {{utf8,<<"message_count">>},{ulong,0}},
  │                  {{utf8,<<"consumer_count">>},{uint,0}},
  │                  {{utf8,<<"name">>},{utf8,<<"cq-145">>}},
  │                  {{utf8,<<"vhost">>},{utf8,<<"/">>}},
  │                  {{utf8,<<"durable">>},{boolean,true}},
  │                  {{utf8,<<"auto_delete">>},{boolean,false}},
  │                  {{utf8,<<"exclusive">>},{boolean,false}},
  │                  {{utf8,<<"type">>},{utf8,<<"classic">>}},
  │                  {{utf8,<<"arguments">>},
  │                   {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}},
  │                  {{utf8,<<"replicas">>},
  │                   {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]},
  │            {[{{resource,<<"/">>,queue,<<"cq-145">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-144">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-143">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-142">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-141">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-140">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-139">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-138">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-137">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-136">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-135">>},configure},
  │              {{resource,<<"/">>,queue,<<"cq-134">>},configure}],
  │             []}}}
  │ [{rabbit_amqp_management,handle_http_req,8,
  │                          [{file,"rabbit_amqp_management.erl"},{line,130}]},
  │  {rabbit_amqp_management,handle_request,5,
  │                          [{file,"rabbit_amqp_management.erl"},{line,43}]},
  │  {rabbit_amqp_session,incoming_mgmt_link_transfer,3,
  │                       [{file,"rabbit_amqp_session.erl"},{line,2317}]},
  │  {rabbit_amqp_session,handle_frame,2,
  │                       [{file,"rabbit_amqp_session.erl"},{line,963}]},
  │  {rabbit_amqp_session,handle_cast,2,
  │                       [{file,"rabbit_amqp_session.erl"},{line,539}]},
  │  {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]},
  │  {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]},
  │  {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]}
```

To repro, run the following command in parallel in two separate terminals:
```
./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic  classic
```

* Simplify
2025-04-11 12:04:00 +02:00
Aaron Seo 6d24aef9b0
Adds rabbit_auth_backend_internal_loopback
This auth backend behaves the same as the internal backend provided in
the core broker, but it only accepts loopback connections. External
connection attempts will receive an error.
2025-04-09 12:53:29 -07:00
Karl Nilsson 274f12f063 Start the coordination Ra system before quorum_queues
This ensures that quorum_queues shuts down _before_
coordination where khepri run inside.
Quorum queues depend on khepri so need to be shut down first.
2025-04-09 12:53:34 +01:00
Jean-Sébastien Pédron dc5a703c23
Merge pull request #12753 from rabbitmq/md/khepri-0-17
Bump Khepri to 0.17.0
2025-04-09 10:26:53 +02:00
Michael Klishin 9bb5dc2ef0
Merge pull request #13698 from rabbitmq/loic-require-auth-api-desc-page
Add new option require_auth_for_api_desc_page to mgmt
2025-04-09 02:29:47 -04:00
Michael Klishin 20188a770e
rabbitmq.conf schema and tests for #13698 2025-04-09 02:02:47 -04:00
Michael Klishin b4fe2cc661
Merge pull request #13703 from rabbitmq/qq-handle-tick-tweaks
QQ: handle tick tweaks
2025-04-08 15:57:59 -04:00
Jean-Sébastien Pédron c8fafa3772
rabbit_db: Note that rabbit_db_msup:create_or_update() is not atomic
... with Khepri.
2025-04-08 18:47:27 +02:00
Jean-Sébastien Pédron 440eb5b355
Khepri: Export `fence/1` 2025-04-08 18:47:27 +02:00
Jean-Sébastien Pédron b4cda4a96a
Improve many testsuites to make them work with mixed versions of Khepri 2025-04-08 18:47:27 +02:00
Jean-Sébastien Pédron 124467e620
rabbitmq_ct_helpers: Use node 2 as seed node, even with secondary umbrella
[Why]
This makes sure that nodes are clustered the same way, whether the tests
are executed with or without a secondary umbrella.
2025-04-08 18:47:27 +02:00
Jean-Sébastien Pédron 4811fd44fd
Khepri: Don't sync cluster if the node is already clustered in `khepri_db` enable function
[Why]
The feature flag enable function is called during the initial migration
or when a node is later added to a cluster.

In this latter situation, the cluster is already formed and the Mnesia
tables were already migrated. Syncing the cluster in this specific
situation might kick another node that is currently unreachable.

[How]
If the node running the enable function is already clustered, we skip
the cluster sync.
2025-04-08 18:47:27 +02:00
Michael Davis f5805b83d2
Khepri: Handle breaking change in khepri adv API return type
[Why]
All callers of `khepri_adv` and `khepri_tx_adv` need updates to handle
the now uniform return type of `khepri:node_props_map()` in Khepri
0.17.0.

[How]
We don't need any compatibility code to handle "either the old return
type or the new return type" from the khepri_adv API because the
translation is done entirely in the "client side" code in Khepri -
meaning that the return value from the Ra server is the same but it is
translated differently by the functions in `khepri_adv`.

However, we need to adapt transaction functions because they may be
executed on different versions of Khepri and the behaviour of
`khepri_tx_adv` can be different. To take the possible change of return
value format, we use the new `khepri_tx:does_api_comply_with/1` to know
what to expect.
2025-04-08 18:47:27 +02:00
Michael Davis 9b5ab14faf
Khepri: Adapt to new khepri_cluster:members/2 API
[Why]
In Khepri 0.17.0, `khepri_cluster:locally_known_members/1` and
`khepri_cluster:locally_known_node/1` were replaced with
`khepri_cluster:members/2` and `khepri_cluster:nodes/2` with `favor` set
to `low_latency` - this matches the interface for queries in Khepri.
2025-04-08 18:47:26 +02:00
Karl Nilsson 27ef97ecd7 QQ: handle_tick improvements
Move leader repair earlier in tick function to ensure more
timely update of meta data store record after leader change.

Also use RPC_TIMEOUT macro for metric/stats multicalls to improve
liveness when a node is connected but partitioned / frozen.
2025-04-08 15:39:20 +01:00
Michal Kuratczyk 6513d028e3
Avoid crash when reporting federation status
This should address crashes like this in (found in user's logs):
```
exception error: no case clause matching
                  [[{connection_details,[]},
                    {name,<<"10.0.13.41:50497 -> 10.2.230.128:5671 (1)">>},
                    {node,rabbit@foobar},
                    {number,1},
                    {user,<<"...">>},
                    {user_who_performed_action,<<"...">>},
                    {vhost,<<"/">>}],
                   [{connection_details,[]},
                    {name,<<"10.0.13.41:50142 -> 10.2.230.128:5671 (1)">>},
                    {node,rabbit@foobar},
                    {number,1},
                    {user,<<"...">>},
                    {user_who_performed_action,<<"...">>},
                    {vhost,<<"/">>}]]
   in function  rabbit_federation_mgmt:format/3 (rabbit_federation_mgmt.erl, line 100)
   in call from rabbit_federation_mgmt:'-status/3-lc$^0/1-0-'/4 (rabbit_federation_mgmt.erl, line 89)
   in call from rabbit_federation_mgmt:'-status/4-lc$^0/1-0-'/3 (rabbit_federation_mgmt.erl, line 82)
   in call from rabbit_federation_mgmt:'-status/4-lc$^0/1-0-'/3 (rabbit_federation_mgmt.erl, line 82)
   in call from rabbit_federation_mgmt:status/4 (rabbit_federation_mgmt.erl, line 82)
   in call from rabbit_federation_mgmt:to_json/2 (rabbit_federation_mgmt.erl, line 57)
   in call from cowboy_rest:call/3 (src/cowboy_rest.erl, line 1590)
   in call from cowboy_rest:set_resp_body/2 (src/cowboy_rest.erl, line 1473)
```
2025-04-08 12:05:10 +02:00
Arnaud Cogoluègnes f10e084c51
Bump Logback to 1.5.18 in JMS-over-AMQP tests
The project uses SLF4J 2.x, Logback 1.5.x is compatible with it.
2025-04-08 09:20:20 +02:00
Arnaud Cogoluègnes 12d094bdb3
Use Netty version from AMQP client in JMS-over-AMQP tests
AMQP Java client uses Netty 4.2, QPid JMS uses Netty 4.1. This commit
forces the use of Netty 4.2 (which is backward-compatible with 4.1).
2025-04-08 09:19:49 +02:00
David Ansari 561376052e Fix type spec for AMQP 1.0 address
The target address can be null which denotes the anonymous terminus.
https://docs.oasis-open.org/amqp/anonterm/v1.0/anonterm-v1.0.html
2025-04-07 16:37:17 +02:00
David Ansari 35b5ab3cdc Determine queue topology without checking queue type
## What?
This commit determines the queue topology without checking the queue type.

 ## Why?
This way, checking leader and replicas works the same across all queue
types without the need to introduce other rabbit_queue_type behaviour as
suggested in other PRs.

 ## How?
pid is the leader, nodes in queue_type_states are the members/replicas.

This commit results in an unknown stream leader during queue
declaration. However the correct leader will be returned eventually when
calling GET on the stream.
2025-04-07 16:37:03 +02:00
Loïc Hoguin 400e8006e5
Add new option require_auth_for_api_desc_page to mgmt
This allows restricting access to the /api/index.html and
the /cli/index.html page to authenticated users should the
user really want to. This can be enabled via advanced.config.
2025-04-07 15:59:13 +02:00
Arnaud Cogoluègnes 6f5c8e0c7f
Pin Java AMQP 1.0 client to 0.5.0
Because of Netty version mismatch with QPid JMS.
2025-04-07 14:54:31 +02:00
dependabot[bot] 74d7fbe3a2
[skip ci] Bump the prod-deps group across 4 directories with 1 update
Bumps the prod-deps group with 1 update in the /deps/rabbit/test/amqp_jms_SUITE_data directory: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_mqtt/test/java_SUITE_data directory: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data directory: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire).
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_stream_management/test/http_SUITE_data directory: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire).


Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.2 to 3.5.3
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.2...surefire-3.5.3)

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.2 to 3.5.3
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.2...surefire-3.5.3)

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.2 to 3.5.3
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.2...surefire-3.5.3)

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.2 to 3.5.3
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.2...surefire-3.5.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-version: 3.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-version: 3.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-version: 3.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-version: 3.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-05 18:51:59 +00:00
Jean-Sébastien Pédron 9704d230fa
quorum_queue_SUITE: Improve reliability of a test
... by waiting for a state.
2025-04-04 18:46:29 +02:00
Michael Klishin e23266253e
Merge pull request #13674 from rabbitmq/avoid-crash-on-stream-connections
Ignore stream connections in unexpected states
2025-04-02 22:56:20 -04:00
Michal Kuratczyk 09ed8fdc07
Ignore stream connections in unexpected states
A connection which terminated before it was fully established
would lead to a function_clause, since metadata is not available
to really call notify_connection_closed. We can just ignore such
connections and not notify about them.

Resolves https://github.com/rabbitmq/rabbitmq-server/discussions/13670
2025-04-02 23:38:55 +02:00
Simon Unge b7c4f66a69 Added 'unlimited' config setting for peer_discovery_retry_limit 2025-04-02 18:34:32 +00:00
Michael Klishin e83c286367
Merge pull request #13643 from rabbitmq/su_aws/try_to_leave_cluster_before_joining
Allow a previously reset node to rejoin its original cluster
2025-04-01 13:20:26 -04:00
Michael Klishin e6bc6a451f
Naming #13643 2025-04-01 12:13:43 -04:00
Marcial Rosales 8dfcfa61e4 Use relative path for the path linked to the cookie
used by mangement ui oauth logic to store the
token until it is moved onto the local storage
2025-04-01 14:02:51 +02:00
Simon Unge 36eb6cafc1 Update spec, noconnection is also a possible error 2025-03-31 21:54:02 +00:00
Simon Unge cdeabe22bc Dont handle the exception just let it out there 2025-03-31 21:16:06 +00:00
Simon Unge e1f2865eae Return the exception 2025-03-31 17:55:49 +00:00
Simon Unge 9ba545cbef Fix dialyzer issue. 2025-03-31 17:52:01 +00:00
Arnaud Cogoluègnes 602b6acd7d
Re-evaluate stream SAC group after connection down event
The same connection can contain several consumers belonging to a SAC
group (group key = vhost + stream + consumer name). The whole new group
must be re-evaluated to select a new active consumer after the consumers
of the down connection are removed from it.

The previous behavior would not re-evaluate the new group and could
select a consumer from the down connection, letting the group with only
inactive consumers, as the selected active consumer would never receive
the activation message from the stream SAC coordinator.

This commit fixes this problem by removing the consumers of the down
down connection from the affected groups and then performing the
appropriate operations for the groups to keep on consuming (e.g.
notifying an active consumer that it needs to step down).

References #13372
2025-03-31 14:59:59 +02:00
dependabot[bot] d5fcab2af2
[skip ci] Bump com.google.googlejavaformat:google-java-format
Bumps the dev-deps group with 1 update in the /deps/rabbit/test/amqp_jms_SUITE_data directory: [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format).


Updates `com.google.googlejavaformat:google-java-format` from 1.25.2 to 1.26.0
- [Release notes](https://github.com/google/google-java-format/releases)
- [Commits](https://github.com/google/google-java-format/compare/v1.25.2...v1.26.0)

---
updated-dependencies:
- dependency-name: com.google.googlejavaformat:google-java-format
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-29 18:07:51 +00:00
Simon Unge dd49cbe6c3 Mnesia: Ask to leave a cluster and retry to join if cluster already consider node a member.
Khepri: no-op. Khepri is less strict already, and rabbit_khepri:can_join would accept a join request from a node that is already a member
2025-03-28 21:24:08 +00:00
Michael Klishin cbb23d65bf
Merge pull request #13648 from rabbitmq/fix-flake-in-rabbit-fifo-int-SUITE
Fix flake(s) in rabbit_fifo_int_SUITE
2025-03-28 14:21:54 -04:00
Karl Nilsson e71fa51925 Speculative flake fix for amqpl_consumer_ack_SUITE.erl 2025-03-28 16:51:32 +00:00
Michal Kuratczyk 9699393da7
[skip ci] fix debug log formatting 2025-03-28 17:47:13 +01:00
Karl Nilsson 1d9f179562 Fix flake(s) in rabbit_fifo_int_SUITE
The start_cluster helper used the same UID (!!) for all members
in the local cluster. This resulted in shared mem tables and
all sorts of havoc.
2025-03-28 13:37:18 +00:00
Michal Kuratczyk f0976b48b2
queue info metric: guard against whereis returning `undefined` (#13646) 2025-03-28 12:37:42 +01:00
Michael Klishin 3756775ebe
Revert "Redirect to end_session_endpoint for idp_initiated logon when it is configured" 2025-03-28 02:31:09 -04:00
Michael Klishin ab8799a739
Redirect to end_session_endpoint for idp-initiated logon
Conflicts:
	selenium/bin/components/fakeportal
2025-03-27 19:01:01 -04:00
Michael Klishin 860bb7c47b
Merge pull request #13638 from rabbitmq/ra-2.16.5 2025-03-27 14:33:19 -04:00
Karl Nilsson 4fe96dfd27 Ra 2.16.5 - bug fixes and minor improvements
Ra improvements:

* Don't allow a non-voter to start elections
* Register with ra directory before initialising ra server.
* Trigger tick_timeout immediately after entering leader state.
* Set a configurable segment max size

This commit also includes a change to turn the quorum queue
become leader callback to become a noop and instead rely on
the more promptly tick_handler to handle the meta data store
update after a leader election.

This more prompt tick update means there should be a much shorter
gap between the queue metrics being deleted from the old leader
node to them being available again on the new node resulting
in smoother message count metrics.

Fix test that relied on waiting on too simplistic a property
before asserting.
2025-03-27 17:06:31 +00:00
Michal Kuratczyk 2a93bbcebd
RMQ-1460: Emit queue_info metric (#13583)
To allow filtering on queue type or membership status,
we need an info metric for queues; see
https://grafana.com/blog/2021/08/04/how-to-use-promql-joins-for-more-effective-queries-of-prometheus-metrics-at-scale/#info-metrics

With this change, per-object metrics and the detailed metrics
(if queue-related families are requested) will contain
rabbitmq_queue_info / rabbitmq_detailed_queue_info with a value of 1
and labels including the queue name, vhost, queue type and membership
status.
2025-03-27 15:54:26 +01:00
David Ansari c151806f7c Apply PR formatting feedback
https://github.com/rabbitmq/rabbitmq-server/pull/13625#discussion_r2016008850
https://github.com/rabbitmq/rabbitmq-server/pull/13625#discussion_r2016010107
2025-03-27 11:30:23 +01:00
David Ansari ef1a595a13 Fix crash when consuming from unavailable quorum queue
Prior to this commit, when a client consumed from an unavailable quorum
queue, the following crash occurred:
```
{badmatch,{error,noproc}}
[{rabbit_quorum_queue,consume,3,[{file,\"rabbit_quorum_queue.erl\"},{line,993}]}
```

This commit fixes this bug by returning any error when registering a
quorum queue consumer to rabbit_queue_type.

This commit also refactors errors returned by
rabbit_queue_type:consume/3 to simplify and ensure seperation of
concerns.

For example prior to this commit, the channel did error
formatting specifically for consuming from streams. It's better if
the channel is unaware of what queue type it consumes from and have each
queue type implementation format their own errors.
2025-03-27 11:30:23 +01:00
David Ansari 44657cd393 Bump timeout in RabbitMQ AMQP 1.0 Erlang client
Bump the timeout for management operations and link attachments from 20s
to 30s. We've seen timeouts in CI.

We bump the poll interval of the `?awaitMatch` macro because CI
sometimes flaked by crashing in
0e803de6dd/deps/rabbitmq_amqp_client/src/rabbitmq_amqp_client.erl (L411)
which indicates that the client lib received a response from a previous
request.
2025-03-27 10:48:49 +01:00
Iliia Khaprov 9efa0d9ffe
RMQ-1263: Shovel Management - add help strings for shovel counters
(cherry picked from commit 8e79a7f500c2df355f3ec7ac1fa1bdd3a8dff6a4)
2025-03-27 00:49:46 -04:00
Iliia Khaprov 6e871f6ab3
RMQ-1263: Shovels Management: show metrics (incl. forwarded counter) in the Shovel Status page
(cherry picked from commit f90dab71f147548c5e9ad921a0bc618179bd34c2)

Conflicts:
	deps/rabbitmq_shovel_management/src/rabbit_shovel_mgmt_util.erl
2025-03-27 00:49:08 -04:00
Luke Bakken 9bcd4328d2
Use case-insensitive `lists:member`
References:
* [`RMQ-1585`](https://vmw-jira.broadcom.net/browse/RMQ-1585)
* https://github.com/lukebakken/rmq-1585
2025-03-26 16:40:23 -07:00
Michael Klishin 03526b51db
#13628 pass Dialyzer 2025-03-26 15:12:24 -04:00
Iliia Khaprov 4eda17bee2 RMQ-1263: An attempt to make shovel status tuple handling backwards compatible 2025-03-26 20:03:09 +01:00
Michael Klishin 11546aafa5
Merge pull request #13620 from rabbitmq/mk-shovel-forwarding-header-and-metric
Shovel: keep track of forwarded message count (a new metric)
2025-03-26 13:54:46 -04:00
Iliia Khaprov 1f20543ee3 RMQ-1263: shovel forward counter: try fixing rolling_upgrade_SUITE 2025-03-26 18:03:20 +01:00
Loïc Hoguin fb985bb8b9
Fix the CLI's main module on Windows 2025-03-26 16:32:38 +01:00
Karl Nilsson 26fa541e2c
Merge pull request #13587 from rabbitmq/qq-checkpointing-tweaks-2
QQ: Revise checkpointing logic to take more frequent checkpoints for large message workloads
2025-03-26 10:43:50 +00:00
Iliia Khaprov 63b5859360 RMQ-1263: readd lost shovel_prometheus parts 2025-03-26 11:22:36 +01:00
Karl Nilsson 6695282640 QQ: Revise checkpointing logic
To take more frequent checkpoints for large message workload

Lower the min_checkpoint_interval substantially to allow quorum queues
better control over when checkpoints are taken.

Track bytes enqueued in the aux state and suggest a checkpoint after
every 64MB enqueued (this value is scaled according to backlog just
like the indexes condition).
This should help with more timely checkpointing when very large
messages is used.

Try evaluating byte size independently of time window

also increase max size
2025-03-26 08:23:52 +00:00
Iliia Khaprov c2569d26f2
RMQ-1263: Shovels forward counter - fix dialyzer
(cherry picked from commit af22cf427a7054d93b3dd64fda01a86649fdd7c5)
2025-03-25 21:11:37 -04:00
Diana Parra Corbacho d4c1121c77
RMQ-1263: dialyze, unused var
(cherry picked from commit 68872f81074d378f76ffa44e7111e7979cdd8fd0)
2025-03-25 21:11:30 -04:00
Iliia Khaprov e3430aa56d
RMQ-1263: Shovel: add forwarded counter
Delayed queuese can automatically create associated Shovels to transfer Ready messages
to the desired destination. This adds forwarded messages counter which will be used
in Management UI for better Shovel internals visibility.

(cherry picked from commit a8800b6cd75d8dc42a91f88655058f2ffa3b6ea6)
2025-03-25 21:11:22 -04:00
Michael Klishin 3a30917809
Merge pull request #13603 from rabbitmq/remove-redundant-queue-type-function
Remove redundant rabbit_queue_type APIs
2025-03-25 17:43:43 -04:00
Loïc Hoguin 0a7c86b480
Fix the exception logged by Cowboy caused by double reply (#13612)
Issue introduced in 383ddb1634.

Authored-by: @lhoguin.
2025-03-25 17:12:57 -04:00
Iliia Khaprov 8ae0163643 Switch is_<queue_type> to using queue.type field
Also, since queue.type field rendered by QueueMod:format and all queues had it hard-coded here,
I unhardcode them here to use Type name.
2025-03-24 19:15:20 +01:00
Karl Nilsson 0410b7e4a6 Remove rabbit_queue_type:to_binary/1
As it is covered by rabbit_queue_type:short_alias_of/1
2025-03-24 16:28:35 +00:00
Karl Nilsson 73c6f9686f Remove rabbit_queue_type:feature_flag_name/1
As this functionality is covered by the rabbit_queue_type:is_enabled/1
API.
2025-03-24 14:49:54 +00:00
Arnaud Cogoluègnes b8244f70f4
Pull from socket up to 10 times in stream test utils (#13588)
To make sure to have enough data to complete a command.
2025-03-24 09:13:31 +01:00
dependabot[bot] 513ade1b8c
[skip ci] Bump the prod-deps group across 2 directories with 3 updates
Bumps the prod-deps group with 1 update in the /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot directory: [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot).
Bumps the prod-deps group with 3 updates in the /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot_kotlin directory: [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot), [org.jetbrains.kotlin:kotlin-test](https://github.com/JetBrains/kotlin) and org.jetbrains.kotlin:kotlin-maven-allopen.


Updates `org.springframework.boot:spring-boot-starter-parent` from 3.4.3 to 3.4.4
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.3...v3.4.4)

Updates `org.springframework.boot:spring-boot-starter-parent` from 3.4.3 to 3.4.4
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.3...v3.4.4)

Updates `org.jetbrains.kotlin:kotlin-test` from 2.1.10 to 2.1.20
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v2.1.10...v2.1.20)

Updates `org.jetbrains.kotlin:kotlin-maven-allopen` from 2.1.10 to 2.1.20

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: prod-deps
- dependency-name: org.jetbrains.kotlin:kotlin-maven-allopen
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-22 18:12:07 +00:00
Michael Klishin f2da1b5544
Extend the idea in #13512 to a few more tabs 2025-03-19 15:44:18 -04:00
Michael Klishin e275f77c4c
HTTP API: tests for the /health/checks/quorum-queues-without-elected* endpoints 2025-03-19 15:44:18 -04:00
Michael Klishin c8f24f535c
New HTTP API health check endpoints
for the check introduced in #13487.

Note that encoding a regular expression pattern
with percent encoding is a pain (e.g. '.*' = '.%2a'),
so these endpoints fall back to a default pattern
value that matches all queues.
2025-03-19 15:44:18 -04:00
David Ansari a7fb56beeb
Auto widen session incoming-window in AMQP 1.0 client
This commit fixes a bug in the Erlang AMQP 1.0 client.

Prior to this commit, to repro this bug:
1. Send more than 2^16 messages to a queue.
2. Grant more than a total of 2^16 link credit initially (on a single link
   or across multiple links) on a single session without any
   auto or manual link credit renewal.

The expectation is that thanks to sufficiently granted initial link-credit,
the client will receive all messages.
However, consumption stops after exactly 2^16-1 messages.

That's because the client lib was never sending a flow frame to the server.
So, after the client received all 2^16-1 messages (the initial
incoming-window set by the client), the server's remote-incoming-window
reached 0 causing the server to stop delivering messages.

The expectation is that the client lib automatically handles session
flow control without any manual involvement of the client app.

This commit implements this fix:
* We keep the server's remote-incoming window always large by default as
  explained in https://www.rabbitmq.com/blog/2024/09/02/amqp-flow-control#incoming-window
* Hence, the client lib sets its incoming-window to 100,000 initially.
* The client lib tracks its incoming-window decrementing it by 1 for
  every transfer it received. (This wasn't done prior to this commit.)
* Whenever this window shrinks below 50,000, the client sends a flow
  frame without any link information widening its incoming-window back to 100,000.
* For test cases (maybe later for apps as well), there is a new function
  `amqp10_client_session:flow/3`, which allows for a test case to do manual
  session flow control. Its API is designed very similar to
  `amqp10_client_session:flow_link/4` in that the test can optionally request
  the lib to auto widen the session window whenever it falls below a certain threshold.
2025-03-19 15:44:18 -04:00
Ayanda Dube 1ccfc0dbfd
extend rabbit_amqqueue_SUITE with internal_no_owner_queue_delete_with/1 and add amqqueue:make_internal/{1,2} type specs 2025-03-19 15:44:17 -04:00
Michael Klishin 2472e450ff
By @efimov90: a dark theme for the management UI (#13567)
This is a squashed commit that includes the following changes by @efimov90:

* Initial-theme-fix

Added light.css
Added dark.css
Added link for light.css and dark.css with media attribute
Added switcher

* Rework-light-style

* dark theme

* Removed not needed div

* Fix folder name

* Color scheme fix

Removes color-scheme from main.css
Added color-scheme: dark to dark.css
Added color-scheme: light to light.css

* Fixed theme switch bug with sammy.js

Adapts code to works with sammy.js

* Icons update

* Reworked theme switcher

* Fix updating attributes

---------

Authored-by: Sergey Efimov <efimov90@gmail.com>
2025-03-19 15:44:17 -04:00