Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] [Amqp] Allow sendable AmqpStamp for failure routing#59161

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
nitneuk wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromnitneuk:fix-amqp-failure-routing

Conversation

nitneuk
Copy link

QA
Branch?7.3
Bug fix?no
New feature?no
Deprecations?no
Issues
LicenseMIT

This PR allows to route message through failure transport using AMQP routing key.

Problem statement:
For business purpose, we wanted to route failed message to different queues. This were impossible due to several things :

  • AmqpStamp implementsNonSendableStampInterface so, it's removed on serialization, and we couldn't retrieve it afterSendFailedMessageToFailureTransportListener sends the envelope to failure transport.
  • if a retry occurred, then theAmqpSender set the routing to the queue name instead of the initial routing key

Example
Here's an example of a messenger configuration that could use it:

framework:    messenger:        failure_transport: failure    transports:        failure:                dsn: '%env(resolve:AMQP_DSN)%/failure_exchange'                options:                    queues:                        failure_queue_1:                            binding_keys: ['routing_key_1']                        failure_queue_2:                            binding_keys: ['routing_key_2']        transport_1:                dsn: '%env(resolve:AMQP_DSN)%/exchange'                options:                    queues:                        queue_1:                            binding_keys: ['routing_key_1']        transport_2:                dsn: '%env(resolve:AMQP_DSN)%/exchange'                options:                    queues:                        queue_2:                            binding_keys: ['routing_key_2']

This config would create :

exchange     \____routing_key_1____ queue_1     \____routing_key_2____ queue_2failure_exchange     \____routing_key_1____ failure_queue_1     \____routing_key_2____ failure_queue_2

aegypius and Margauxfeslard reacted with eyes emoji
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@chalasrchalasr self-requested a reviewDecember 11, 2024 12:10
@chalasr
Copy link
Member

I couldn't find a good reason for this stamp to be non-sendable except that no use case needed it yet. This one looks legit so 👍 for me. Can you add some words about this change to the bridge's CHANGELOG?

@stof
Copy link
Member

Some of the stamp attributes don't make sense to be serialized and sent alongside another message (like the message id for instance). So maybe only a subset of it should be sendable. But I don't know enough about the internals of Messenger to be sure about it.

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@chalasrchalasrAwaiting requested review from chalasr

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

5 participants
@nitneuk@carsonbot@chalasr@stof@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp