Giter Site home page Giter Site logo

laravel-yandex-message-queue's Introduction

Laravel Yandex Message Queue

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Этот модуль расширяет стандартную реализацию работы с очередями SQS и сделан специально для работы с реализацией SQS от команды Яндекс.Облако.

Главный недостаток реализации SQS со стороны Яндекс.Облако - непереносимость между средами, названия очередей содержат их идентификатор, например, вместо стандартного названия очереди default в Яндекс.Облаке такая очередь будет называться dj6000000002a9pq22in/default

Installation

You can install the package via composer:

composer require chelout/laravel-yandex-message-queue

В файле config/queue.php необходимо описать соединение, которое будет использоваться:

<?php

return [
    // ...

    'connections' => [
        // ...

        'ymq' => [
            'driver'    => 'ymq',
            'key'       => env('YANDEX_MESSAGE_QUEUE_KEY'),
            'secret'    => env('YANDEX_MESSAGE_QUEUE_SECRET'),
            'prefix'    => env('YANDEX_MESSAGE_QUEUE_PREFIX', 'https://message-queue.api.cloud.yandex.net/your-account-id'),
            'queue'     => env('YANDEX_MESSAGE_QUEUE_QUEUE', 'default'),
            'suffix'    => env('YANDEX_MESSAGE_QUEUE_SUFFIX'),
            'region'    => env('YANDEX_MESSAGE_QUEUE_REGION', 'ru-central1'),
            'queue_map' => [
                'default' => env('YANDEX_MESSAGE_QUEUE_DEFAULT'),
            ],
        ],
    ],

    // ...
];

В queue_map описывается массив соответствия алиасов названий очередей и их реальных названий.

Usage

TestJob::dispatch(['foo' => 'bar'])
    ->onConnection('ymq')
    ->onQueue('default');

TODO

  • tests

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-yandex-message-queue's People

Contributors

chelout avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.