Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrubau committed Mar 8, 2020
1 parent a543eab commit 9c4fb78
Show file tree
Hide file tree
Showing 17 changed files with 4,035 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.vscode
vendor
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
language: php

matrix:
include:
- php: 7.3
dist: bionic
env: COMPOSER_OPTS=""
- php: 7.3
dist: bionic
env: COMPOSER_OPTS="--prefer-lowest"
- php: 7.4
dist: bionic
env: COMPOSER_OPTS=""
- php: 7.4
dist: bionic
env: COMPOSER_OPTS="--prefer-lowest"
- php: nightly
dist: bionic
env: COMPOSER_OPTS="--ignore-platform-reqs"
- php: nightly
dist: bionic
env: COMPOSER_OPTS="--ignore-platform-reqs --prefer-lowest"
allow_failures:
- php: nightly
env: COMPOSER_OPTS="--ignore-platform-reqs"
- php: nightly
env: COMPOSER_OPTS="--ignore-platform-reqs --prefer-lowest"

install:
- travis_retry composer update --prefer-dist $COMPOSER_OPTS

script:
- composer test
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2020 Alexandru Bau

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# messenger-azure-queue-transport
Azure Storage Queue transport for Symfony's Messenger component.
Azure Queue transport for Symfony's Messenger component.

[![Travis (.org)](https://img.shields.io/travis/alexandrubau/messenger-azure-queue-transport?style=flat-square)](https://travis-ci.org/alexandrubau/azure-queue-transport-bundle)
[![Packagist Version](https://img.shields.io/packagist/v/alexandrubau/messenger-azure-queue-transport?style=flat-square)](https://packagist.org/packages/alexandrubau/azure-queue-transport-bundle)
[![Software License](https://img.shields.io/github/license/alexandrubau/messenger-azure-queue-transport?style=flat-square)](https://github.com/alexandrubau/azure-queue-transport-bundle/blob/master/LICENSE)

## Installation

azure-queue-transport-bundle requires PHP 7.3+ and Symfony 4.3+.

You can install the bundle using Symfony Flex:

```
composer require alexandrubau/messenger-azure-queue-transport
```

## Basic usage

Set environment variable:

```
MESSENGER_TRANSPORT_DSN=azurequeue://<account_name>:<account_key>/default
```

In case your Account Name or Account Key contain special characters, you can use PHP's `rawurlencode()` function to encode them.

Set messenger transport config:

```yaml
framework:
messenger:
transports:
azure_queues:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
queue_name: <your_queue_name>
visibility_timeout: <visibility_timeout_in_seconds>
time_to_live: <time_to_live_in_seconds>
results_limit: <how_many_messages_to_read>
```
Don't forget to create the queue with the supplied name in Azure Queue Storage.
## Further reading
1. [The Messenger Component](https://symfony.com/doc/current/components/messenger.html)
2. [Messenger: Sync & Queued Message Handling](https://symfony.com/doc/current/messenger.html)
3. [Azure Storage Queue](https://docs.microsoft.com/en-gb/azure/storage/queues/?toc=%2fazure%2fstorage%2fqueues%2ftoc.json)
4. [Azure Storage Queue REST API](https://docs.microsoft.com/en-gb/rest/api/storageservices/queue-service-rest-api)
33 changes: 33 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "alexandrubau/messenger-azure-queue-transport",
"type": "symfony-bundle",
"description": "Azure Storage Queue transport for Symfony's Messenger component.",
"keywords": ["symfony", "bundle", "messenger", "transport" ,"azure", "storage", "queue"],
"license": "MIT",
"authors": [
{
"name": "Alexandru Bau",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Abau\\MessengerAzureQueueTransport\\": "src/"
}
},
"require": {
"php": "^7.3",
"symfony/config": "^4.3|^5.0",
"symfony/dependency-injection": "^4.3|^5.0",
"symfony/http-kernel": "^4.3|^5.0",
"symfony/messenger": "^4.3|^5.0",
"microsoft/azure-storage-queue": "^1.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"symfony/var-dumper": "^4.3|^5.0"
},
"scripts": {
"test": "phpunit tests --testdox"
}
}
Loading

0 comments on commit 9c4fb78

Please sign in to comment.