1. Go to this page and download the library: Download pmill/rabbit-rabbit-slack 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/ */
pmill / rabbit-rabbit-slack example snippets
$config = new RabbitConfig([
'baseUrl' => 'localhost:15672',
'username' => 'guest',
'password' => 'guest',
]);
$manager = new ConsumerManager($config);
$vhostName = '/';
$queueName = 'messages';
$slackWebhookUrl = '';
$manager->addRule(
new SlackRule(
$vhostName,
$queueName,
$slackWebhookUrl,
'There are currently :messageCount ready messages in :vhostName/:queueName'
),
new GreaterThan(5000)
);
$manager->run();