定制 avto-dev/rabbitmq-api-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

avto-dev/rabbitmq-api-client

最新稳定版本:v2.8.0

Composer 安装命令:

composer require avto-dev/rabbitmq-api-client

包简介

RabbitMQ API Client implementation

README 文档

README

Laravel

RabbitMQ API Client

Version PHP Version Build Status Coverage Downloads count License

This package adds into your PHP application RabbitMQ API client implementation.

Install

Require this package with composer using the following command:

$ composer require avto-dev/rabbitmq-api-client "^2.0"

Installed composer is required (how to install composer).

You need to fix the major version of package.

After that you can "publish" package configuration file using following command:

$ php artisan vendor:publish --provider="AvtoDev\\RabbitMqApiClient\\Frameworks\\Illuminate\\LaravelServiceProvider"

Usage

At first, you should create API client instance:

<?php

use AvtoDev\RabbitMqApiClient\Client;
use AvtoDev\RabbitMqApiClient\ConnectionSettings;

$client = new Client(new ConnectionSettings('http://127.0.0.1:15672', 'guest', 'guest'));

// And after that you can execute API commands, for example:

$client::version();     // Client version, like `1.0.0`
$client->healthcheck(); // `true` or `false`
$client->queueInfo('some-queue-name'); // Object with information about queue

If you are using Laravel framework with registered package service-provider, you can resolve client instance using DI, for example:

<?php

namespace App\Console\Commands;

use AvtoDev\RabbitMqApiClient\ClientInterface;

class SomeCommand extends \Illuminate\Console\Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'some:command';

    /**
     * Execute the console command.
     *
     * @param ClientInterface $client
     *
     * @return void
     */
    public function handle(ClientInterface $client): void
    {
        $client->healthcheck(); // `true` or `false`
    }
}

Testing

For package testing we use phpunit framework and docker with compose plugin as develop environment. So, just write into your terminal after repository cloning:

$ make build
$ make latest # or 'make lowest'
$ make test

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-19