Skip to content
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

The auto-config for handler classes seems not to work (manual config is required) #19

Open
Moongazer opened this issue Jan 12, 2023 · 6 comments

Comments

@Moongazer
Copy link

Moongazer commented Jan 12, 2023

The extension CompilerPass sets a configuration to tag MessageHandlerInterface classes with messenger.message_handler:

$container->registerForAutoconfiguration(MessageHandlerInterface::class)->addTag('messenger.message_handler');

But just implementing the interface for a custom handler class seems not be enough, the handler is never called and all messages are rejected. Only if we manually add the handler-class with this tag to our Services.yaml the handler is executed:

services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  Vendor\MyExt\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'

  Vendor\MyExt\Messenger\Handler\MyJobHandler:
    tags:
      - name: 'messenger.message_handler'

Is this expected behaviour or is here missing something? Strange is, that in BOTH cases (with and without manual configuration), the tag never shows up in the cached DI file di/DependencyInjectionContainer_4a...2a.php: after clearing the cache, searching for messenger.message_handler return 0 results.

@sabbelasichon
Copy link
Contributor

@Moongazer I have created another package wich integrates Symfony Messenger seamlessly in TYPO3. We are using it in a really big TYPO3 Application and it works quite well.
I have talked to @svewap (the creator of this package) and for him it is fine to mention my package here.
https://github.com/sabbelasichon/t3_messenger

I would be happy to join forces and make improvements together to bring this nice feature / component to a broader audience.

@sabbelasichon
Copy link
Contributor

@Moongazer The described problem here doesn´t exist in my package. It works. You can even use PHP Attributes if you are using PHP 8.1

@Moongazer
Copy link
Author

@sabbelasichon Thanks for the hint! It depends a bit how fast I will be able to upgrade to v12, because than the Messenger is available as core-feature. If too many of my used extensions are not v12 ready mid of this year, I'll consider to give t3_messenger a shot too 👍🏼

@sabbelasichon
Copy link
Contributor

Are you sure that the Messenger Integration in the core is feature complete?

@Moongazer
Copy link
Author

Not sure, I think I read or heard somewhere that its not feature complete, but can't find the resource right now for details, nor the patch on Gerrit.

This article says it uses a "basic implementation", whatever that means.
This post also has no further details.

Do you know anything more?

@sabbelasichon
Copy link
Contributor

I don't really know. But as far as i can see, i would consider it not feature complete out of the box. But i will have to check when we switch to version 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants