Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Feb 13, 2025

Initialising a message container from data stored in a
stream is a special case where we need to recover exchange
and routing key information from the following message annatations:

  • x-exchange
  • x-routing-key
  • x-cc

We do not want to do this when initialising a message container
from AMQP data just received from a publisher.

This commit introduces a new function mc_amqp:init_from_stream/2
that is to be used when needing a message container from a stream
message.


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

Initialising a message container from data stored in a
stream is a special case where we need to recover exchange
and routing key information from the following message annatations:

* x-exchange
* x-routing-keys
* x-cc

We do not want to do this when initialising a message container
from AMQP data just received from a publisher.

This commit introduces a new function `mc_amqp:init_from_stream/2`
that is to be used when needing a message container from a stream
message.

(cherry picked from commit 32615bf)
(cherry picked from commit 91e3180)

# Conflicts:
#	deps/rabbit/src/mc_amqp.erl
#	deps/rabbit/src/rabbit_stream_queue.erl
@mergify mergify bot added the conflicts label Feb 13, 2025
@mergify
Copy link
Author

mergify bot commented Feb 13, 2025

Cherry-pick of 91e3180 has failed:

On branch mergify/bp/v4.0.x/pr-13339
Your branch is up to date with 'origin/v4.0.x'.

You are currently cherry-picking commit 91e3180a5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deps/rabbit/src/mc_amqp.erl
	both modified:   deps/rabbit/src/rabbit_stream_queue.erl

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@michaelklishin
Copy link
Collaborator

After resolving the conflict seemingly correctly, most test suites pass but a few fail, such as

mc_unit_SUITE > tests > amqpl_cc_amqp_bin_amqpl
    #1. {error,{{assertEqual,[{module,mc_unit_SUITE},
                              {line,453},
                              {expression,"mc : routing_keys ( Msg10 )"},
                              {expected,[<<"apple">>,<<"q1">>,<<"q2">>]},
                              {value,[]}]},
                [{mc_unit_SUITE,amqpl_cc_amqp_bin_amqpl,1,
                                [{file,"mc_unit_SUITE.erl"},{line,453}]},
                 {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
                 {test_server,run_test_case_eval1,6,
                              [{file,"test_server.erl"},{line,1303}]},
                 {test_server,run_test_case_eval,9,
                              [{file,"test_server.erl"},{line,1235}]}]}}

mc_unit_SUITE > tests > amqpl_amqp_bin_amqpl
    #1. {error,{{assertEqual,[{module,mc_unit_SUITE},
                              {line,367},
                              {expression,"mc : exchange ( Msg10 )"},
                              {expected,<<"exch">>},
                              {value,undefined}]},
                [{mc_unit_SUITE,amqpl_amqp_bin_amqpl,1,
                                [{file,"mc_unit_SUITE.erl"},{line,367}]},
                 {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]},
                 {test_server,run_test_case_eval1,6,
                              [{file,"test_server.erl"},{line,1303}]},
                 {test_server,run_test_case_eval,9,
                              [{file,"test_server.erl"},{line,1235}]}]}}

@kjnilsson can you please take a look?

@michaelklishin michaelklishin added this to the 4.0.7 milestone Feb 13, 2025
@ansd
Copy link
Member

ansd commented Feb 14, 2025

We don't need this backport.

@ansd ansd closed this Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants