1. Go to this page and download the library: Download uzapoint/eventbus-core 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/ */
use Uzapoint\EventBus\RabbitMQService;
app(RabbitMQService::class)->publish(
exchange: 'business.events',
routingKey: 'tenant.registration.initiated',
data: [
'auth_user_id' => 12,
'email' => '[email protected]',
],
headers: ['idempotency_key' => $key], // optional: used as the event id
);
'idempotency' => [
'enabled' => true,
'ttl' => 3600, // how long a successfully processed event is remembered
'lock_ttl' => 120, // processing lock, released if the handler fails
'redis_prefix' => 'event:processed:',
],