Commit 7ae5000
committed
Support AMQP 1.0 natively
ATTACH target
TRANSFER from client to server
ATTACH source
Merge session files
Merge files rabbit_amqp1_0_session_process and rabbit_amqp1_0_session.
Handle deliver action
DETACH link and END session
Fix credit reply from quorum queue
Make following tests green:
```
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:reliable_send_receive_with_outcomes_classic
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:reliable_send_receive_with_outcomes_quorum
```
Settle with state released if unroutable
Fixes the following test:
```
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:publishing_to_non_existing_queue_should_settle_with_released
```
Handle drain
Make follwing tests green:
```
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:roundtrip_classic_queue_with_drain
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:roundtrip_quorum_queue_with_drain
```
Handle send_credit_reply action
Make the following test green:
```
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:roundtrip_stream_queue_with_drain
```
Fix test expectation
Make the following test green:
```
make -C deps/rabbitmq_amqp1_0/ ct-amqp10_client t=tests:message_headers_conversion
```
With Native AMQP, the behaviour of
```
Convert AMQP 0.9.1 message headers to application properties for an AMQP 1.0 consumer
amqp1_0.convert_amqp091_headers_to_app_props = false | true (default false)
Convert AMQP 1.0 Application Properties to AMQP 0.9.1 headers
amqp1_0.convert_app_props_to_amqp091_headers = false | true (default false)
```
https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/rabbitmq_amqp1_0#configuration
will break because we always convert according to the message container conversions.
For example, 091 x-headers will go into message-annotations instead of application properties.
Also, false won’t be respected since we always convert the headers with message containers.
Either we decide to have this breaking change with Native AMQP or we need to respect the
old behaviour of application parameters amqp1_0.convert_amqp091_headers_to_app_props and
amqp1_0.convert_app_props_to_amqp091_headers when doing the message container conversions.
Register connection
Make the following test green:
```
make -C deps/rabbitmq_amqp1_0/ ct-proxy_protocol
```
Delete unused code
Fix message annotation test expectation
With message containers, the broker will include x-exchange and
x-routing-key message annotations.
Serialize footer
makes the following test green:
```
make -C deps/rabbitmq_amqp1_0 ct-system t=dotnet:footer
```
Set first-acquirer in header
Makes the following test green:
```
make -C deps/rabbitmq_amqp1_0 ct-system t=dotnet:redelivery
```
Fix queue confirmation crash
Makes the following test green:
```
make -C deps/rabbitmq_amqp1_0/ ct-system t=dotnet:routing
```
Add some authz checks
to make the following tests green:
```
make -C deps/rabbitmq_amqp1_0/ ct-system t=dotnet:access_failure
make -C deps/rabbitmq_amqp1_0/ ct-system t=dotnet:access_failure_not_allowed
make -C deps/rabbitmq_amqp1_0/ ct-system t=dotnet:access_failure_send
```
Delete unused code
Adapt test expectation
Makes the following test green:
```
make -C deps/rabbitmq_amqp1_0/ ct-system t=dotnet:streams
```
Fix dialyzer warnings
bazel run gazelle
excluding any changes for deps/proper
Handle undefined msg ID from queue
Makes the following tests green:
```
make -C deps/amqp10_client/ ct-system
```
Classic queues send an 'undefined' message ID to the channel when
no ack is required. No ack is required when the send settle mode is
settled. In this case it should be perfectly valid to always send the
same (empty binary) delivery-tag from server to client.
mix format deps/rabbitmq_cli/lib/rabbitmqctl.ex
using Mix 1.15.4 (compiled with Erlang/OTP 26)
Convert gen_server2 to gen_server
Fix crash when basic message is received
Makes the following test green:
```
bazel test //deps/rabbitmq_amqp1_0:amqp10_client_SUITE-mixed
```
Remove #outgoing_link.default_outcome
Rename unconfirmed to incoming_unsettled_map
to better match the AMQP spec terminology.
Fix cherry-pick build failure
Add MQTT 5.0 <-> AMQP 1.0 assertions
Simplify rabbit_channel
by removing extra AMQP 1.0 logic for settling unroutable messages with
released state.
This commit reverts the workaround introduced by PR 8015.
Remove rabbit_queue_collector
rabbit_queue_collector is responsible for synchronously deleting
exclusive queues. Since the AMQP 1.0 plugin never creates exclusive
queues, rabbit_queue_collector doesn't need to be started in the first
place. This will save 1 Erlang process per AMQP 1.0 connection.
Use 1 writer process per AMQP 1.0 connection
AMQP 0.9.1 uses a separate rabbit_writer Erlang process per
AMQP 0.9.1 channel.
Prior to this commit, AMQP 1.0 used a separate rabbit_amqp1_0_writer
Erlang process per AMQP 1.0 session.
Advantage of single writer proc per session (prior to this commit):
* High parallelism for serialising packets if multiple sessions within
a connection write heavily at the same time.
This commit uses a single writer process per AMQP 1.0 connection that is
shared across all AMQP 1.0 sessions.
Advantages of single writer proc per connection (this commit):
* Lower memory usage with hundreds of thousands of AMQP 1.0 sessions
* Less TCP and IP header overhead given that the single writer process
can accumulate across all sessions bytes worth a MSS before flushing
the socket.
In other words, this commit decides that a reader / writer process pair
per AMQP 1.0 connection is good enough for bi-directional TRANSFER flows.
Having a writer per session is too heavy. The final goal by previous
commits and follow-up commits is to reduce the total number of Erlang
processes to allow hundreds of thousands of AMQP clients to connect
while keeping resource usage in RabbitMQ at a low level.
We still ensure high thoughput by having separate reader, writer, and
session processes.
Remove one supervisory level
Given that we now have 1 writer per AMQP 1.0 connection, this commit
changes the supervisor hierarchy such that only 1 additional process
(rabbit_amqp1_0_session) is created per AMQP 1.0 session.
Fix dialyze and xref
`bazel run gazelle` wrongly removes the dependency on amqp_client
due to a bug in the gazelle plugin.
For now, we add a directive.
Transform rabbit_amqp1_0_writer into gen_server
Why:
Prior to this commit, when clicking on the AMQP 1.0 writer process in
observer, the process crashed.
Instead of handling all these debug messages of the sys module, it's
much better to implement a gen_server.
There is no advantage of using a special OTP process over gen_server
for the AMQP 1.0 writer.
gen_server also provides cleaner format status output.
How:
Message callbacks return a timeout of 0.
After all messages in the inbox are processed, the timeout message is
handled by flushing any pending bytes.
Add test for multiple sessions on same connection
given that a single writer is used across multiple sessions.
Remove stats timer from writer
AMQP 1.0 connections haven't emitted any stats previously.
Since Native AMQP 1.0 is targeted for 4.0 where metrics delivery via the
Management API is removed anyway, we remove the stats timer from the 1.0
writer in this commit.
Add better test for CLI connections listing
Display connection properties in Management UI
Make rabbit_confirms more efficient
use lists:foldl/3 instead of lists:foldr/3.
The returned order of confirmed sequence numers is not important since
rabbit_channel will sort them anyway.
Avoid lists:any/2 by checking within preceeding lists:foldl/3
Fix flawed serial number arithmetic
Batch confirms and rejections
When there are contiguous queue confirmations in the session process
mailbox, batch them. When the confirmations are sent to the publisher, a
single DISPOSITION frame is sent for contiguously confirmed delivery
IDs and for the special case where no confirmations are outstanding
anymore.
This approach should be good enough. However it's sub optimal in
scenarios where contiguous delivery IDs that need confirmations are rare,
for example:
* There are multiple links in the session with different sender
settlement modes and sender publishes across these links interleaved.
* sender settlement mode is mixed and sender publishes interleaved settled
and unsettled TRANSFERs.1 parent ee7c6d9 commit 7ae5000
File tree
50 files changed
+2908
-3003
lines changed- deps
- amqp10_client
- src
- test
- rabbit_common
- include
- src
- rabbitmq_amqp1_0
- include
- src
- test
- system_SUITE_data/fsharp-tests
- rabbitmq_mqtt
- src
- test
- rabbit
- src
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+2908
-3003
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
| 83 | + | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | 337 | | |
340 | 338 | | |
341 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 73 | + | |
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
| |||
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
147 | | - | |
| 144 | + | |
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
| 175 | + | |
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | | - | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
186 | | - | |
187 | | - | |
| 185 | + | |
188 | 186 | | |
189 | 187 | | |
190 | 188 | | |
| |||
193 | 191 | | |
194 | 192 | | |
195 | 193 | | |
196 | | - | |
| 194 | + | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 19 | + | |
| 20 | + | |
32 | 21 | | |
33 | 22 | | |
34 | 23 | | |
| |||
344 | 333 | | |
345 | 334 | | |
346 | 335 | | |
347 | | - | |
| 336 | + | |
348 | 337 | | |
349 | 338 | | |
350 | 339 | | |
| |||
379 | 368 | | |
380 | 369 | | |
381 | 370 | | |
382 | | - | |
| 371 | + | |
383 | 372 | | |
384 | 373 | | |
385 | 374 | | |
| |||
398 | 387 | | |
399 | 388 | | |
400 | 389 | | |
401 | | - | |
| 390 | + | |
402 | 391 | | |
403 | 392 | | |
404 | | - | |
| 393 | + | |
405 | 394 | | |
406 | 395 | | |
407 | 396 | | |
| |||
676 | 665 | | |
677 | 666 | | |
678 | 667 | | |
679 | | - | |
680 | | - | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
681 | 672 | | |
682 | 673 | | |
683 | | - | |
| 674 | + | |
684 | 675 | | |
685 | 676 | | |
686 | 677 | | |
| |||
704 | 695 | | |
705 | 696 | | |
706 | 697 | | |
707 | | - | |
| 698 | + | |
| 699 | + | |
708 | 700 | | |
709 | 701 | | |
710 | 702 | | |
711 | 703 | | |
712 | 704 | | |
713 | 705 | | |
714 | 706 | | |
715 | | - | |
| 707 | + | |
| 708 | + | |
716 | 709 | | |
717 | 710 | | |
718 | 711 | | |
719 | 712 | | |
720 | 713 | | |
721 | 714 | | |
722 | 715 | | |
723 | | - | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
724 | 719 | | |
725 | | - | |
| 720 | + | |
| 721 | + | |
726 | 722 | | |
727 | 723 | | |
728 | 724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
177 | 184 | | |
178 | 185 | | |
179 | 186 | | |
| |||
185 | 192 | | |
186 | 193 | | |
187 | 194 | | |
188 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
189 | 206 | | |
190 | 207 | | |
191 | | - | |
192 | 208 | | |
193 | 209 | | |
194 | 210 | | |
| |||
408 | 424 | | |
409 | 425 | | |
410 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
411 | 431 | | |
412 | 432 | | |
413 | 433 | | |
| |||
432 | 452 | | |
433 | 453 | | |
434 | 454 | | |
435 | | - | |
436 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
437 | 459 | | |
438 | 460 | | |
439 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments