Skip to content

Fix amqp091->amqp10 shovel with complex headers (backport #13798) #13801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Apr 25, 2025

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}]}]}

Fixes #13797


This is an automatic backport of pull request #13798 done by Mergify.

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}]}]}
```

(cherry picked from commit c5271ea)
@mergify mergify bot added the make label Apr 25, 2025
@michaelklishin michaelklishin added this to the 4.1.1 milestone Apr 25, 2025
@michaelklishin michaelklishin merged commit 968bfdd into v4.1.x Apr 25, 2025
271 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.1.x/pr-13798 branch April 25, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy