reedtechus / azure-service-bus-laravel
Provides an interface to Azure's Service Bus.
Requires
- php: ^8.1
- illuminate/contracts: ^9.0
- sammyjo20/saloon-cache-plugin: 2.0.0-beta2
- sammyjo20/saloon-laravel: 2.0.0-beta3
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.4
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.19
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.9
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-09 08:45:56 UTC
README
Azure Service Bus SDK for Laravel / PHP
Provides an interface to Azure's Service Bus.
This package provides an interface to Azure Service Bus.
It implements the Azure Service Bus REST API via Saloon v2.
⚠️ Experimental: This package is still in development and is not ready for production use. Breaking changes can still occur without a major version change until 1.0.0.
Installation
You can install the package via composer:
composer require reedtechus/azure-service-bus-laravel
You can publish the config file with:
php artisan vendor:publish --tag="azure-service-bus-laravel-config"
This is the contents of the published config file:
return [ 'tenant' => env('SERVICE_BUS_TENANT'), 'namespace' => env('SERVICE_BUS_NAMESPACE'), 'cache_driver' => env('SERVICE_BUS_CACHE_DRIVER', 'redis'), ];
Usage
Send a Message to a Queue or Topic
AzureServiceBus::send('queue_or_topic_name', ['payload_data' => 'goes_here'])
Receive a Message from a Queue
Peek (Non-destructive read) a message from a queue:
AzureServiceBus::peek('queue_name')
Peek (Non-destructive read) a message from a topic (via subscription):
AzureServiceBus::peek('queue_name', 'subscription_name')
Destructive Read
The above peek
examples can be replaced with pop
to perform a destructive read and remove the message from the queue / subscription.
Pop (Destructive read) a message from a queue:
AzureServiceBus::pop('queue_name')
Pop (Destructive read) a message from a topic (via subscription):
AzureServiceBus::pop('queue_name', 'subscription_name')
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.