Skip to content

[Messenger] fix BC for FrameworkBundle 4.4 with a non-existence alias being used #41553

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

Conversation

monteiro
Copy link
Contributor

@monteiro monteiro commented Jun 5, 2021

Q A
Branch? 5.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #41545 ...
License MIT

When trying to update symfony/messenger to 5.3 while still using symfony/framework-bundle 4.4 there is an error:

The service "console.command.messenger_failed_messages_retry" has a dependency on a non-existent service "messenger.failure_transports.default".

This is because in Symfony Messenger 5.3, on the PR #38468 to support multiple failure transports we have created an alias, that is only available on the FrameworkBundle 5.3.

This fix will use an already existence alias.

Sample project to test this behavior: https://github.com/monteiro/PR-41553-symfony

@monteiro monteiro requested a review from sroze as a code owner June 5, 2021 15:08
@carsonbot carsonbot added this to the 5.3 milestone Jun 5, 2021
@monteiro
Copy link
Contributor Author

monteiro commented Jun 5, 2021

Can you help us review this BC @weaverryan

@derrabus derrabus requested a review from weaverryan June 5, 2021 15:25
@carsonbot carsonbot changed the title fix BC for FrameworkBundle 4.4 with a non-existence alias being used [Messenger] fix BC for FrameworkBundle 4.4 with a non-existence alias being used Jun 5, 2021
@monteiro
Copy link
Contributor Author

monteiro commented Jun 6, 2021

I was able to test the behaviour with this repository. Feel fee to test it too. Everything seems to work fine, and the global failed transport is set correctly.

I tested using the AMQP transport in the repository.

@carsonbot
Copy link

Hey!

I think @DavidBadura has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. This makes sense to me: in symfony/messenger 5.3 + framework-bundle 4.4, we still need this $failureTransportsMap but there will probably only be just the 1 failure transport (it's technically possible someone could tag there own, and that's fine - it would be handled below this code like normal).

Anyways, this patch takes that one failure transport and puts it into the array. Makes sense

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in my project 👍

@nicolas-grekas nicolas-grekas force-pushed the fix-bc-on-symfony4.4-messenger branch from 0f5dddc to aa0e166 Compare June 8, 2021 14:01
@nicolas-grekas
Copy link
Member

Thank you @monteiro.

@nicolas-grekas nicolas-grekas merged commit d85847c into symfony:5.3 Jun 8, 2021
@fabpot fabpot mentioned this pull request Jun 17, 2021
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.

7 participants