PHP code example of a-mazalov / kali-message-broker
1. Go to this page and download the library: Download a-mazalov/kali-message-broker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
a-mazalov / kali-message-broker example snippets
use Kali\MessageBroker\Messages\Data\Test;
use Kali\MessageBroker\Notifications\RabbitmqMessageNotification;
$testData = new Test(email: "[email protected]", message: "Hello World!");
$routing_key = "access" // очередь сервиса в который необходимо отправить сообщение. Роутинг настраивается через Exchange в админке RabbitMQ
Notification::route("rabbitmq", $routing_key)->notify(
new RabbitmqMessageNotification("TestJob", $testData->toResource())
);