diff options
author | dcorbacho <dparracorbacho@piotal.io> | 2021-11-29 10:13:08 +0100 |
---|---|---|
committer | dcorbacho <dparracorbacho@piotal.io> | 2021-11-29 10:13:08 +0100 |
commit | 835f809b94dba5c97eec219e091dd39439783334 (patch) | |
tree | ab153f1e44359294ec23446e1323f62e0280cf9c /deps/rabbit/src | |
parent | a7af1f815fa8db7f96cb75dd152ae729deb0dc6b (diff) | |
download | rabbitmq-server-git-message-container.tar.gz |
WIP message containermessage-container
Diffstat (limited to 'deps/rabbit/src')
-rw-r--r-- | deps/rabbit/src/rabbit_message_container.erl | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/deps/rabbit/src/rabbit_message_container.erl b/deps/rabbit/src/rabbit_message_container.erl index fcfe6d769c..f1c25c695f 100644 --- a/deps/rabbit/src/rabbit_message_container.erl +++ b/deps/rabbit/src/rabbit_message_container.erl @@ -11,21 +11,46 @@ -type(message_container() :: #message_container{protocol :: atom(), - data :: any(), - parsed :: boolean(), - annotations :: map()}). + data :: any(), %% should be the binaries only #content.payload_fragments_rev + decoded :: boolean(), + properties :: map(), + headers :: map(), + annotations :: map() + }). + +%% Annotations contain: +%%% routing_keys +%%% exchange +%%% msg_id +%%% flags like persistent + +%% Properties are everything that goes on 'P_basic' for amqp091, many map to AMQP 1.0 +%% I think all AMQP 1.0 properties go here, even though they are later split in properties and +%% application properties + +%% Things like headers, routing keys, exchange or id are only changed by dead-lettering + +%% Ops +%%% get/set for all fields +%%% prepare_to_store to strip down encoded/decoded data for disk storage +%%% serialize (which should probably do the format conversion) +%%% msg_size + +%% Headers handling +%% Probably the ugliest part, dlx adds but also deletes some headers. +%% I think they should be handled like an special case for annotations -export([new/3, new/4, get_data/1, get_internal/2, set_internal/3, prepare_to_store/1, serialize/1, msg_size/1]). -spec new(atom(), any(), boolean()) -> message_container(). -new(Protocol, Data, Parsed) -> - new(Protocol, Data, Parsed, #{}). +new(Protocol, Data, Decoded) -> + new(Protocol, Data, Decoded, #{}). -new(Protocol, Data, Parsed, Annotations) -> +new(Protocol, Data, Decoded, Annotations) -> #message_container{protocol = Protocol, data = Data, - parsed = Parsed, + decoded = Decoded, annotations = Annotations}. get_data(#message_container{data = Data}) -> |