pmill/rabbit-rabbit-slack
Composer 安装命令:
composer require pmill/rabbit-rabbit-slack
包简介
A slack integration for pmill/rabbit-rabbit
README 文档
README
Introduction
This library is an integration for pmill/rabbit-rabbit allows you to post to Slack channels when RabbitMQ queues message counts match conditions.
Requirements
This library package requires PHP 7.1 or later, and a slack account.
Installation
The recommended way to install is through Composer.
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest version:
composer require pmill/rabbit-rabbit-slack
Slack Setup
You will need to generate a webhook URL for the channel you want to post messages to, to do this:
- Create a Slack app
- Create an incoming webhook URL to the app for each channel you want to post to
Usage
The following example will post the message count for your queue in your Slack channel when the message count is greater
than 5000. There is a complete example in the examples/ folder.
$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();
Version History
0.1.0 (12/04/2018)
- First public release of rabbit-rabbit-slack
Copyright
pmill/rabbit-rabbit-slack Copyright (c) 2018 pmill (dev.pmill@gmail.com) All rights reserved.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-11