Receive ACP Messages

Edit on GitHub

Your Spryker project can receive ACP messages using the following commands:

Receive messages from all channels:

console message-broker:consume

Receive messages from a specific channel:

console message-broker:consume {channel-name} # {channel-name} is the name of the channel, like `asset-commands`.

Receiving messages automatically

The preceding command must be executed periodically. To set up a periodic execution, configure Jenkins in config/Zed/cronjobs/jenkins.php:

if (\Spryker\Shared\Config\Config::get(\Spryker\Shared\MessageBroker\MessageBrokerConstants::IS_ENABLED)) {
    $jobs[] = [
        'name' => 'message-broker-consume-channels',
        'command' => $logger . '$PHP_BIN vendor/bin/console message-broker:consume --time-limit=15 --sleep=5',
        'schedule' => '* * * * *',
        'enable' => true,
    ];
}

The conditional clause verifies if the message broker is enabled. If enabled, the job is added to the list of scheduled jobs during the next deployment.