pmill/rabbit-rabbit-ecs 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pmill/rabbit-rabbit-ecs

Composer 安装命令:

composer require pmill/rabbit-rabbit-ecs

包简介

An AWS ECS integration for pmill/rabbit-rabbit

README 文档

README

Introduction

This library is an integration for pmill/rabbit-rabbit allows you to set the desired task count for Amazon ECS services when RabbitMQ queues message counts match conditions.

Requirements

This library package requires PHP 7.1 or later, and a previously setup auto-scaling Amazon ECS service.

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-ecs

Usage

The following example will set the service desired task count to 1 if the number of messages in the queue is less than 5000, if the count is greater than 5000 then it will set the desired task count to 3. 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';
$ecsClusterName = 'default';
$ecsServiceName = 'sample-webapp';

$ecsClient = new EcsClient([
    'version' => 'latest',
    'region' => 'eu-west-1',
    'credentials' => [
        'key' => '',
        'secret' => '',
    ],
]);

$manager->addRule(
    new EcsRule(
        $vhostName,
        $queueName,
        $ecsClient,
        $ecsClusterName,
        $ecsServiceName,
        1
    ),
    new CountBetween(0, 4999)
);

$manager->addRule(
    new EcsRule(
        $vhostName,
        $queueName,
        $ecsClient,
        $ecsClusterName,
        $ecsServiceName,
        3
    ),
    new GreaterThan(5000)
);

$manager->run();

Version History

0.1.0 (12/04/2018)

  • First public release of rabbit-rabbit-ecs

Copyright

pmill/rabbit-rabbit-ecs Copyright (c) 2018 pmill (dev.pmill@gmail.com) All rights reserved.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固