$ composer require sylake/sylius-consumer-plugin
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);
}
# app/config/config.yml
old_sound_rabbit_mq:
connections:
default:
host: 'localhost'
port: 5672
user: 'guest'
password: 'guest'
$ bin/console rabbitmq:consumer sylake
Adding a product postprocessor allows to change product before saving it.
Create a class which implements Sylake\SyliusConsumerPlugin\Projector\Product\ProductPostprocessorInterface
.
Define it as a service with tag sylake_sylius_consumer.projector.product.postprocessor
.
:tada: