eZ Accelerator is back!

And it brings asynchronicity in eZ Platform via Symfony Messenger.

Sébastien Morel
2 min readJul 20, 2020

I was waiting for it for a while and they did it a few months ago:

eZ Platform 3.x is now fully based on Symfony 5.

While it’s great in terms of dependencies and deprecations mechanism for the future, it’s awesome in terms of features and components we can now use. We move from Symfony 3.4 to 5.x that’s something.

Almost 10 years ago we released eZ Accelerator for eZ Publish. Back then the benefits were enormous because we were adding HTTP cache using Varnish on top of eZ.

Despite the fact eZ Platform does not have any performance issues, the more the better and being able to do actions asynchronously is always an improvement.

Welcome eZ Accelerator for eZ Plaform the DXP by Ibexa.

This new bundle leverages Symfony Messenger and adds asynchronicity to eZ Platform allowing many things with no overhead and quite the opposite accelerating native actions.

For now, it allows you to:

  • catch and dispatch asynchronously any Events.
    A small bullet point but a wide range of subjects can be addressed here from the simple content management features to the e-commerce features through personalization features. All the DXP will benefit from this. (Careful though not all events can be handle asynchronously)
  • handle HTTP Cache Purge asynchronously
  • handle Search Indexation asynchronously
  • what else? you tell us (comment here, or the Github Issue is open) and/or you’re welcome as a contributor if you feel like it!

Native Bonus: You can inject Middlewares into the game and any other cool stuff Symfony Messenger is providing.

The bundle is just a first step, I would love it to be enriched by the great community we have.

Implementation

That was kind of straight forward:

  • decorations of services to call the bus instead of doing the actions right away
  • a compiler pass to listen to user-configured event to dispatch through the bus.
  • a semantic configuration to make it simpler for users
  • some tricks to manage the “SiteAccess Awareness”

SiteAccess Aware

SiteAccess management is always tricky, the bundle includes a MiddleWare that will tag messages so you can have access to the original SiteAccess in the Handler.

But that is not enough, the consumers are long-running scripts and they could handle different Messages coming from different SiteAccess and therefore with a different configuration. Thankfully Symfony Messenger comes with 2 options that will help you in those situations:

  • receiver: so you can specify what transport to consume
  • bus: so you can specify the bus o dispatch received messages

Using those configurations + the native siteaccess option that comes with eZ Platform you should be fine.

Conclusion

This is only the first version! As mentioned it could become something more, if we all contribute ;-)

eZ Accelerator for eZ Publish ended up being integrated into the eZ Publish kernel, my guess is Symfony Messenger in eZ Platform makes so much sense.

Anyway, we are proud and excited to release this first version of eZ Accelerator.

The documentation is ready, please enjoy the beta1 and don’t hesitate to give us your feedback!

--

--

Sébastien Morel
Sébastien Morel

Written by Sébastien Morel

CTO @AlmaviaCX / Head of U.S. | #web #mobile #innovation #symfony #ezplatform #php #ios #docker #varnish #opensource #dad #plop

No responses yet