mammoth-autumn-37948
06/29/2023, 1:28 PMEventBehaviorEventDispatcherPlugin was added in the dispatcher list. So far so good..let`s say.
But the problem arose the moment we noticed that in the GlueStorefrontApplication the EventDispatcherApplicationPlugin plugin was missing in the list of Application Plugins (\Pyz\GlueStorefrontApiApplication\GlueStorefrontApiApplicationDependencyProvider::getApplicationPlugins). Once you add this (of course the Glue one) you trigger a lot of problems since the plugin event dispatchers are in common and the Storefront cannot run the EventBehaviorEventDispatcherPlugin since it has no dependency with propel etc.. that the plugin needs.
Now two things are: should be separated the event dispatcher plugins based on the application, as done between zed and yves, or the plugins should be inserted based on the current application.
Does anyone have the same problem encountered?
@green-ocean-22823 U are the person that released it under ticket CC-27948. Do u have an idea why the EventDispatcherApplicationPlugin is missing for Storefront and why the EventBehaviorEventDispatcherPlugin was added even if it cannot run for Storefront?
Thank u in advance and BR
Gio
p.s.: if the EventDispatcherApplicationPlugin is missing in Storefront then for every call u have the error as follow:
Spryker.CRITICAL: Spryker\Service\Container\Exception\NotFoundException - The requested service "dispatcher" was not found in the container! in "/current/vendor/spryker/container/src/Spryker/Service/Container/Container.php::262" {"exception":"[object] (Spryker\\Service\\Container\\Exception\\NotFoundException(code: 0): The requested service \"dispatcher\" was not found in the container! at /current/vendor/spryker/container/src/Spryker/Service/Container/Container.php:262)
[stacktrace]
#0 /current/vendor/spryker/container/src/Spryker/Service/Container/Container.php(216): Spryker\\Service\\Container\\Container->getService('dispatcher')
#1 /current/vendor/spryker/http/src/Spryker/Glue/Http/Plugin/Application/HttpApplicationPlugin.php(159): Spryker\\Service\\Container\\Container->get('dispatcher')
#2 /current/vendor/spryker/http/src/Spryker/Glue/Http/Plugin/Application/HttpApplicationPlugin.php(94): Spryker\\Glue\\Http\\Plugin\\Application\\HttpApplicationPlugin->getEventDispatcher(Object(Spryker\\Shared\\Kernel\\Container\\ContainerProxy))
#3 /current/vendor/spryker/container/src/Spryker/Service/Container/Container.php(279): Spryker\\Glue\\Http\\Plugin\\Application\\HttpApplicationPlugin->Spryker\\Glue\\Http\\Plugin\\Application\\{closure}(Object(Spryker\\Shared\\Kernel\\Container\\ContainerProxy))
#4 /current/vendor/spryker/container/src/Spryker/Service/Container/Container.php(216): Spryker\\Service\\Container\\Container->getService('kernel')
#5 /current/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(196): Spryker\\Service\\Container\\Container->get('kernel')
#6 /current/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(178): Spryker\\Shared\\Application\\Application->getKernel()
#7 /current/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/ApiApplication/ApiApplicationProxy.php(190): Spryker\\Shared\\Application\\Application->terminate(Object(Symfony\\Component\\HttpFoundation\\Request), Object(Symfony\\Component\\HttpFoundation\\Response))
#8 /current/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/ApiApplication/ApiApplicationProxy.php(159): Spryker\\Glue\\GlueApplication\\ApiApplication\\ApiApplicationProxy->terminateApplication(Object(Spryker\\Glue\\GlueStorefrontApiApplication\\Application\\GlueStorefrontApiApplication), Object(Symfony\\Component\\HttpFoundation\\Response))
#9 /current/public/GlueStorefront/index.php(20): Spryker\\Glue\\GlueApplication\\ApiApplication\\ApiApplicationProxy->run()
#10 {main}
"} {"environment":{"application":"GLUE_STOREFRONT","environment":"production","codeBucket":"DE","store":"DE","locale":"de_DE"},"server": ....plain-city-95899
06/29/2023, 1:36 PMgreen-ocean-22823
06/29/2023, 1:44 PMEventBehaviorEventDispatcherPlugin is executed, so the entities in spy_event_behavior_entity_change are processed without delay. However, when an entity is created / updated / deleted via Backend API, the EventBehaviorEventDispatcherPlugin is not executed, so events are being processed only by event:trigger:timeout console command that is executed every 5 minutes. So, we possibly need to enable EventBehaviorEventDispatcherPlugin (or provide a similar plugin) for Backend API. The same issue is possibly actual for Storefront API as well.
The last sentence is wrong because Storefront API has the same approach that we have in deprecated GLUE.
Requests from SAPI/GLUE applications will go to ZED application throw zed-call (if you want persist something in DB). In Zed application we handle it by default.
So regarding issue, BAPI didn’t make real zed-call and it means that in BAPI we do direct call to Facade. During persistent calls (using BAPI) we lost the handler of such create/update/delete events.green-ocean-22823
06/29/2023, 1:47 PMmammoth-autumn-37948
06/29/2023, 1:57 PMmammoth-autumn-37948
06/29/2023, 1:58 PMgreen-ocean-22823
06/29/2023, 1:59 PMthe problem though seems to be that in SAPI the EntityEventDispatcher plugin generates error... Are you aware of this?I couldn’t find it in https://github.com/spryker-shop/suite/blob/master/src/Pyz/Glue/GlueStorefrontApiApplication/GlueStorefrontApiApplicationDependencyProvider.php
mammoth-autumn-37948
06/29/2023, 2:01 PMgreen-ocean-22823
06/29/2023, 2:04 PMmammoth-autumn-37948
06/29/2023, 2:05 PM