You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When a resource use both the messenger and a custom processor, either the messages are not created if using messenger=true, or the processor is not called if using messenger='input'.
Additional Context
I need to generate thumbnails on MediaObjects after creation. I want to use Symfony Messenger to trigger this and do it asynchronously since it could take time some to process.
Note: when using messenger=true ApiResource attribute in a Doctrine entity, the Doctrine Processor is not called. If you want the Doctrine Processor to be called, you should decorate a built-in state processor and implement your own logic.
The text was updated successfully, but these errors were encountered:
DurandA
changed the title
Async messenger not working if using processor on same resource
Messenger not working if using processor on same resource
Aug 24, 2023
The problem with this solution is that the messenger will not be called immediately if it is asynchronous. I need a processor that is called immediately and a message handler that is called asynchronously since it could take several seconds to execute.
Can you not dispatch an event through the message bus, after the entity is persisted? The event handler can dispatch the GenerateThumbnailCommand, or just execute your logic in the event handler.
API Platform version(s) affected: 3.1
Description
When a resource use both the messenger and a custom processor, either the messages are not created if using
messenger=true
, or the processor is not called if usingmessenger='input'
.How to reproduce
services.yaml
messenger.yaml
Additional Context
I need to generate thumbnails on MediaObjects after creation. I want to use Symfony Messenger to trigger this and do it asynchronously since it could take time some to process.
The processor is used to persists the entity. As described in Symfony Messenger Integration:
The text was updated successfully, but these errors were encountered: