|
1 | | --type death_key() :: {SourceQueue :: rabbit_misc:resource_name(), rabbit_dead_letter:reason()}. |
2 | | --type death_anns() :: #{first_time := non_neg_integer(), %% the timestamp of the first |
3 | | - last_time := non_neg_integer(), %% the timestamp of the last |
4 | | - ttl => OriginalExpiration :: non_neg_integer()}. |
5 | | --record(death, {exchange :: OriginalExchange :: rabbit_misc:resource_name(), |
6 | | - routing_keys = [] :: OriginalRoutingKeys :: [rabbit_types:routing_key()], |
7 | | - count = 0 :: non_neg_integer(), |
8 | | - anns :: death_anns()}). |
9 | | - |
10 | | --record(deaths, {first :: death_key(), |
11 | | - last :: death_key(), |
12 | | - records = #{} :: #{death_key() := #death{}}}). |
13 | | - |
14 | | - |
15 | 1 | %% good enough for most use cases |
16 | 2 | -define(IS_MC(Msg), element(1, Msg) == mc andalso tuple_size(Msg) == 5). |
17 | 3 |
|
|
26 | 12 | -define(ANN_RECEIVED_AT_TIMESTAMP, rts). |
27 | 13 | -define(ANN_DURABLE, d). |
28 | 14 | -define(ANN_PRIORITY, p). |
| 15 | + |
| 16 | +-define(FF_MC_DEATHS_V2, message_containers_deaths_v2). |
| 17 | + |
| 18 | +-type death_key() :: {SourceQueue :: rabbit_misc:resource_name(), rabbit_dead_letter:reason()}. |
| 19 | +-type death_anns() :: #{%% timestamp of the first time this message |
| 20 | + %% was dead lettered from this queue for this reason |
| 21 | + first_time := pos_integer(), |
| 22 | + %% timestamp of the last time this message |
| 23 | + %% was dead lettered from this queue for this reason |
| 24 | + last_time := pos_integer(), |
| 25 | + ttl => OriginalTtlHeader :: non_neg_integer()}. |
| 26 | + |
| 27 | +-record(death, {exchange :: OriginalExchange :: rabbit_misc:resource_name(), |
| 28 | + routing_keys :: OriginalRoutingKeys :: [rabbit_types:routing_key(),...], |
| 29 | + %% how many times this message was dead lettered from this queue for this reason |
| 30 | + count :: pos_integer(), |
| 31 | + anns :: death_anns()}). |
| 32 | + |
| 33 | +-record(deaths, {first :: death_key(), % redundant to mc annotations x-first-death-* |
| 34 | + last :: death_key(), % redundant to mc annotations x-last-death-* |
| 35 | + records :: #{death_key() := #death{}} |
| 36 | + }). |
0 commit comments