PHPackages                             aldidigitalservices/lean-publisher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. aldidigitalservices/lean-publisher

ActiveLibrary[Caching](/categories/caching)

aldidigitalservices/lean-publisher
==================================

Lean publishing module for Spryker

v1.0.3(3y ago)31.1k2[1 PRs](https://github.com/ALDIDigitalServices/LeanPublisher/pulls)MITPHP

Since Mar 10Pushed 1y ago3 watchersCompare

[ Source](https://github.com/ALDIDigitalServices/LeanPublisher)[ Packagist](https://packagist.org/packages/aldidigitalservices/lean-publisher)[ RSS](/packages/aldidigitalservices-lean-publisher/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (8)Versions (7)Used By (0)

ALDI Lean Publisher
===================

[](#aldi-lean-publisher)

Description
-----------

[](#description)

The Lean Publisher is a publication process that is based on sprykers "Publish &amp; Synchronize" process ().

The goal of this process is to make data available in the frontend-centric data storages like Redis and Elasticsearch.

The Lean Publisher is meant to be used in connection with a spryker system.

[![Screenshot](data/aldi_lean_publisher.png)](data/aldi_lean_publisher.png)

Benefits
--------

[](#benefits)

1. Lean publisher centralizes all writing operations so that the connected modules do not need to think about bulk publishing
2. The synchronization into Redis and Elasticsearch happens synchronously - preventing out of sync storage data
3. The amount of queues, events and messages is drastically reduced which improves the performance of the RabbitMQ in high throughput environments
4. The event mapping is improved and centralized in one place. Making the connection of the publisher processes easier to understand
5. Provides a guiding structure for the implementing modules, so that there is not too many different approaches to publishing

Installation
------------

[](#installation)

`composer require ALDIDigitalservices/lean-publisher`

Integration
-----------

[](#integration)

---

### config\_default.php

[](#config_defaultphp)

add "ALDIDigitalServices" to your CORE\_NAMESPACES in config\_default.php

```
$config[KernelConstants::CORE_NAMESPACES] = [
	...
	'ALDIDigitalServices',
	...
];
```

---

### Console

[](#console)

In `src/Pyz/Zed/Console/ConsoleDependencyProvider.php` please register

```
[...]
new LeanPublisherResynchronizationConsole(),
[...]
```

Available commands:

`docker/sdk console lean-publisher:sync $RESOURCE $IDS`

with $RESOURCE beeing the resource you want to publish

and $IDS beeing a list of comma separated entity ids to publish

---

### Event

[](#event)

In `src/Pyz/Zed/Event/EventDependencyProvider.php` register

```
[...]
$eventSubscriberCollection->add(new LeanPublisherEventSubscriber());
[...]
```

Connecting your module to the Lean Publisher
--------------------------------------------

[](#connecting-your-module-to-the-lean-publisher)

If you want to connect your entity to the Lean Publisher you need to follow these steps:

---

#### Step 1: Create your publishing module

[](#step-1-create-your-publishing-module)

We suggest starting a module with "&lt;ENTITY\_NAME&gt;Publish". So for example CategoryPublish, MerchantPublish etc.

---

#### Step 2: Create a new queue + retry queue

[](#step-2-create-a-new-queue--retry-queue)

in `src/Pyz/Zed/Queue/QueueDependencyProvider.php` using the `LeanPublisherQueueMessageProcessorPlugin`

```
[...]
PublishConfig::PUBLISH_MY_ENTITY_QUEUE_NAME => new LeanPublisherQueueMessageProcessorPlugin(),
PublishConfig::PUBLISH_MY_ENTITY_RETRY_QUEUE_NAME => new EventRetryQueueMessageProcessorPlugin()
[...]
```

---

#### Step 3: Register retry and error configuration in

[](#step-3-register-retry-and-error-configuration-in)

In `src/Pyz/Client/RabbitMq/RabbitMqConfig.php` add

```
[...]
PublishConfig::PUBLISH__QUEUE_NAME => [
    static::ROUTING_KEY_RETRY => PublishConfigConfig::PUBLISH__RETRY_QUEUE_NAME,
    static::ROUTING_KEY_ERROR => PublishConfigConfig::PUBLISH__ERROR_QUEUE_NAME,
],
[...]
```

Setup the new registered queue via console command. `docker/sdk console queue:setup`

---

#### Step 4: Create a database table that follows the Lean Publisher conventions

[](#step-4-create-a-database-table-that-follows-the-lean-publisher-conventions)

```

```

Create the new table via the console command:

`docker/sdk console propel:schema:copy && docker/sdk console propel:model:build && docker/sdk console propel:diff && docker/sdk console propel:migrate && docker/sdk console transfer:entity:generate`

---

#### Step 5: Create an EventHandler Plugin that implements Lean Publisher Interfaces

[](#step-5-create-an-eventhandler-plugin-that-implements-lean-publisher-interfaces)

InterfaceDescriptionLeanPublisherEventHandlerPluginInterfacegeneral Lean Publisher event handler interface. Needed for communication with the Lean Publisher.LeanPublisherStoragePublishPluginInterfaceIf you want to publish to storage, you need this interface.LeanPublisherSearchPublishPluginInterfaceIf you want to publish to search, you need this interface.---

#### Step 6: Register the EventHandler

[](#step-6-register-the-eventhandler)

In `src/Pyz/Zed/LeanPublisher/LeanPublisherDependencyProvider.php::getEventHandlerPlugins()`

```
return [
    [...]
    PublishConfig::PUBLISH__QUEUE_NAME => new PublishEventHandlerPlugin(),
    [...]
];
```

---

#### Step 7: Create and register a PublisherTriggerPlugin

[](#step-7-create-and-register-a-publishertriggerplugin)

Create a PublishTriggerPlugin implementing **both** PublisherTriggerPluginInterface, LeanPublisherTriggerPluginInterface and set it up in `\Pyz\Zed\Publisher\PublisherDependencyProvider::getPublisherTriggerPlugins`

```
return [
    [...]
     new PublishPublisherTriggerPlugin(),
     [...]
];
```

---

#### Step 8: Set up jobs to process the events

[](#step-8-set-up-jobs-to-process-the-events)

Depending on your setup you need to add jenkins jobs or other jobs to process messages from your `publish.ENTITY_NAME` queue

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

1207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfd1bb01549ca18ea1e311e68530467a417a6048343634c976f11207e9270e34?d=identicon)[ALDIDigitalServices](/maintainers/ALDIDigitalServices)

---

Top Contributors

[![greinerdavid](https://avatars.githubusercontent.com/u/3600696?v=4)](https://github.com/greinerdavid "greinerdavid (9 commits)")

---

Tags

elasticsearchpublishredissprykerstoragesynchronize

### Embed Badge

![Health badge](/badges/aldidigitalservices-lean-publisher/health.svg)

```
[![Health](https://phpackages.com/badges/aldidigitalservices-lean-publisher/health.svg)](https://phpackages.com/packages/aldidigitalservices-lean-publisher)
```

###  Alternatives

[spryker/search

Search module

152.9M84](/packages/spryker-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
