sylake/sylius-consumer-plugin

This package is abandoned and no longer maintained. No replacement package was suggested.

Integrates Sylius with message processing for sylake/akeneo-producer-bundle.

Installs: 1 293

Dependents: 0

Suggesters: 0

Security: 0

Stars: 15

Watchers: 11

Forks: 5

Open Issues: 2

Type:sylius-plugin

v1.0.0-beta.11 2017-11-10 15:33 UTC

README

SyliusConsumerPlugin

Installation

  1. Require this package:
$ composer require sylake/sylius-consumer-plugin
  1. Add bundles to AppKernel.php of existing Sylius application:
public function registerBundles()
{
    $bundles = [
        new \SimpleBus\SymfonyBridge\SimpleBusCommandBusBundle(),
        new \SimpleBus\SymfonyBridge\SimpleBusEventBusBundle(),
        new \OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
        new \SyliusLabs\RabbitMqSimpleBusBundle\RabbitMqSimpleBusBundle(),
        new \Sylake\SyliusConsumerPlugin\SylakeSyliusConsumerPlugin(),
    ];

    return array_merge(parent::registerBundles(), $bundles);
}
  1. Configure RabbitMQ default connection:
# app/config/config.yml

old_sound_rabbit_mq:
    connections:
        default:
            host: 'localhost'
            port: 5672
            user: 'guest'
            password: 'guest'

Usage

  1. Run the following command to listen for messages and consume them:
$ bin/console rabbitmq:consumer sylake

Extending product projector

Adding a product postprocessor allows to change product before saving it.

  1. Create a class which implements Sylake\SyliusConsumerPlugin\Projector\Product\ProductPostprocessorInterface.

  2. Define it as a service with tag sylake_sylius_consumer.projector.product.postprocessor.

  3. 🎉