Giter Site home page Giter Site logo

laravel-azure-servicebus-topic's Introduction

Windows Azure Servicebus driver for Laravel

Overview

The library provides support for both Service Bus queues and topic based messaging (topics haven't been tested yet but should work). Default is Service Bus queues, for topic based messaging UseTopic should be set to true. The package should be auto discovered on Laravel > 5.6

Latest Stable Version Total Downloads License

Installation

Require this package in your composer.json:

"goavega-software/laravel-azure-servicebus": "<<version>>"

Run composer update!

After composer update is finished you need to add ServiceProvider to your providers array in app/config/app.php (this is only needed for laravel < 5.6):

'Goavega\LaravelAzureServicebusTopic\Support\Serviceprovider',

add the following to the connection array in app/config/queue.php, and fill out your own connection data from the Azure Management portal:

'azureservicebus' => array(
    'driver'       => 'azureservicebus',
    'endpoint'     => 'https://*.servicebus.windows.net',
    'SharedAccessKeyName' => '',
    'SharedAccessKey' => 'primary key',
    'queue'        => '<topic name>',
    'UseTopic' => true/false (default false)
)

Usage

The library provides support for both Service Bus queues and topic based messaging. Default is Service Bus queues, for topic based messaging UseTopic should be set to true. Once you completed the configuration you can use Laravel Queue API. If you do not know how to use Queue API, please refer to the official Laravel documentation.

From laravel Queue documentation, something like this should work:

        $payload = new \stdClass();
        $payload->id = 1;
        $payload->name = 'hello world';
        ProcessPodcast::dispatch($payload)->onConnection('azureservicebus')->onQueue('queue-name');

artisan worker should be started as per Laravel's official documentation:

php artisan queue:listen azureservicebus --queue=queue-name

Azure Topic Support

There is no support (yet) of automatically creating subscriptions on the Azure Topic. A known subscription identifier is instead used for the subscription and needs to be created manually on the service bus. The identifier is 6c7dd8f3e3e145a5b9782b41d741c951

Version compatiblity

The package uses semantic versioning and tries to match Laravel versions.

  • Use version 2.x if you are on Laravel 5.5
  • Use version 5.x if you are on Laravel 5.6-5.8
  • 6.x if you are on Laravel 6.x
  • 7.x if you are on Laravel 7.x
  • dev-master if you are on Laravel 8.x (see compat notes below)

Laravel 8x Support

[-Warning-] This package relies on Windows-Azure SDK for PHP which has been abandoned and hasn't had an upgrade in last 2 years. This has resulted in incompatible dependencies (especiailly with GuzzleHttp - see #2). We've decided to fork the windows-azure package and just keep pieces of Service Bus. Since the fork is still not published (there are still few unit tests that fail and have to be verified if they fail due to invalid test cases or due to broken functionality), the only way to include this package for Laravel 8.x is by usng dev-master. composer.json

"repositories": [{
        "type": "git",
        "url": "https://github.com/sn123/azure-sdk-for-php.git"
    }],
"require: {
        ...
        "goavega-software/laravel-azure-servicebus": "dev-master"
},

Rest everything should work the same as older laravels.

laravel-azure-servicebus-topic's People

Contributors

ling5821 avatar sn123 avatar

Watchers

 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.