2017 © Pedro Pelรกez
 

library laravel-mns

Aliyun MNS Queue Driver For Laravel

image

yaojingwei/laravel-mns

Aliyun MNS Queue Driver For Laravel

  • Wednesday, December 20, 2017
  • by davidyao
  • Repository
  • 1 Watchers
  • 0 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 12 Versions
  • 4 % Grown

The README.md

Aliyun MNS Queue Driver For Laravel

Latest Version on Packagist ![Software License][ico-license] ![Total Downloads][ico-downloads], (*1)

Install

Via Composer, (*2)

``` bash $ composer require lokielse/laravel-mns, (*3)


## Config Add following service providers into your providers array in `config/app.php` ``` php Lokielse\LaravelMNS\LaravelMNSServiceProvider::class

Edit your config/queue.php, add mns connection, (*4)

'mns'        => [
    'driver'       => 'mns',
    'key'          => env('QUEUE_MNS_ACCESS_KEY'),
    'secret'       => env('QUEUE_MNS_SECRET_KEY'),
    'endpoint'     => env('QUEUE_MNS_ENDPOINT'),
    'queue'        => env('QUEUE_NAME'),
    'wait_seconds' => 30,
]

About wait_seconds, (*5)

Edit your .env file, (*6)

QUEUE_DRIVER=mns
QUEUE_NAME=foobar-local
QUEUE_MNS_ACCESS_KEY=your_acccess_key
QUEUE_MNS_SECRET_KEY=your_secret_key
QUEUE_MNS_ENDPOINT=http://12345678910.mns.cn-hangzhou.aliyuncs.com/

You should update QUEUE_MNS_ENDPOINT to internal endpoint in production mode, (*7)

Usage

First create a queue and get queue endpoint at Aliyun MNS Console, (*8)

Then update MNS_ENDPOINT in .env, (*9)

Push a test message to queue, (*10)

Queue::push(function($job){
    /**
     * Your statments go here
     */
    $job->delete();
});

Create queue listener, run command in terminal, (*11)

$ php artisan queue:listen

Commands

Flush MNS messages on Aliyun, (*12)

$ php artisan queue:mns:flush

Security

Create RAM access control at Aliyun RAM Console, (*13)

  1. Create a custom policy such as AliyunMNSFullAccessFoobar, (*14)

    {
      "Version": "1",
      "Statement": [
        {
          "Action": "mns:*",
          "Resource": [
            "acs:mns:*:*:*/foobar-local",
            "acs:mns:*:*:*/foobar-sandbox",
            "acs:mns:*:*:*/foobar-production"
          ],
          "Effect": "Allow"
        }
      ]
    }
    
  2. Create a user for you app such as foobar, (*15)

  3. Assign the policy AliyunMNSFullAccessFoobar to the user foobar, (*16)

  4. Create and get the AccessKeyId and AccessKeySecret for user foorbar, (*17)

  5. update QUEUE_MNS_ACCESS_KEY and QUEUE_MNS_ACCESS_SECRET in .env, (*18)

Change log

Please see CHANGELOG for more information what has changed recently., (*19)

Testing

bash $ composer test, (*20)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*21)

Credits

License

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

The Versions

20/12 2017

dev-master

9999999-dev https://github.com/yaojingwei/laravel-mns

Aliyun MNS Queue Driver For Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cloud queue driver aliyun ้˜ฟ้‡Œไบ‘ ons mts lokielse laravel-mns ้˜Ÿๅˆ—

09/04 2017

v1.0.10

1.0.10.0 https://github.com/lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cloud queue driver aliyun ้˜ฟ้‡Œไบ‘ ons mts lokielse laravel-mns ้˜Ÿๅˆ—

09/04 2017

v1.0.9

1.0.9.0 https://github.com/lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cloud queue driver aliyun ้˜ฟ้‡Œไบ‘ ons mts lokielse laravel-mns ้˜Ÿๅˆ—

09/04 2017

v1.0.8

1.0.8.0 https://github.com/lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cloud queue driver aliyun ้˜ฟ้‡Œไบ‘ ons mts lokielse laravel-mns ้˜Ÿๅˆ—

12/07 2016

v1.0.7

1.0.7.0 https://github.com/lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel cloud queue driver aliyun ้˜ฟ้‡Œไบ‘ ons mts lokielse laravel-mns ้˜Ÿๅˆ—

12/07 2016
12/07 2016
12/07 2016
12/07 2016
12/07 2016
12/07 2016
11/07 2016