gdx / p-service-bus-symfony-bundle
PServiceBus
Installs: 20 512
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 2
Type:symfony-bundle
pkg:composer/gdx/p-service-bus-symfony-bundle
Requires
- php: >=8.3
- gdx/p-service-bus: ^2.13.0
- symfony/config: ^v7.2.0
- symfony/dependency-injection: ^v7.2.0
- symfony/http-kernel: ^v7.2.2
Requires (Dev)
- doctrine/doctrine-bundle: ^2.13.1
- doctrine/orm: ^3.3.1
- phpunit/phpunit: ^10.5.41
- rector/rector: ^2.0.6
- roave/security-advisories: dev-latest
- symfony/framework-bundle: ^v7.2.2
- vimeo/psalm: ^7.0.0-beta11
- dev-master
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.0
- 0.11.1
- 0.11.0
- 0.10.1
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6.0
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.1.1
- 0.1.0
- dev-version-2
- dev-transport-filter-meddages
- dev-add-transport-groups
This package is auto-updated.
Last update: 2026-02-05 10:06:48 UTC
README
Telegram group: https://t.me/PServiceBus
For library https://gitlab.com/GDXbsv/pservicebus
Symfony: https://packagist.org/packages/gdx/p-service-bus-symfony-bundle
Laravel: https://packagist.org/packages/gdx/p-service-bus-laravel-package
As example for config please look in TestApp folder: https://gitlab.com/GDXbsv/pservicebus-symfony-bundle/-/tree/master/TestApp
Example initialization file config/packages/p-service-bus.php:
<?php declare(strict_types=1);
use GDXbsv\PServiceBus\Bus\ConsumeBus;
use GDXbsv\PServiceBus\Transport\InMemoryTransport;
use GDXbsv\PServiceBus\Transport\Sns\SnsSqsTransport;
use GDXbsv\PServiceBus\Transport\Sqs\SqsTransport;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use function Symfony\Component\DependencyInjection\Loader\Configurator\inline_service;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension(
'p_service_bus',
[
'transports' => [
'memory' => InMemoryTransport::class,
'external' => SnsSqsTransport::class,
'example_name_for_transport' => 'app.service_bus.transport.example_sqs',
'example_name_for_transport2' => 'app.service_bus.transport.example_sqs2',
],
'transport_groups' => [
'example_group' => ['example_name_for_transport', 'example_name_for_transport2'],
],
]
);
$s = $containerConfigurator->services();
$s->defaults()
->autowire()
->autoconfigure();
$s->set(InMemoryTransport::class)
->call('setBus', [service(ConsumeBus::class)]);
$s
->set(SnsSqsTransport::class)
->factory([SnsSqsTransport::class, 'ofDsn'])
->arg('$dsnString', '%env(SNS_DSN)%')
->arg('$sqsTransport', inline_service(SqsTransport::class)
->factory([SqsTransport::class, 'ofDsn'])
->arg('$dsnString', '%env(SQS_DSN)%&queue=core_external')
);
$s
->set('app.service_bus.transport.example_sqs')
->class(SqsTransport::class)
->factory([SqsTransport::class, 'ofDsn'])
->arg('$dsnString', '%env(SQS_DSN)%&queue=core_example_name');
$s
->set('app.service_bus.transport.example_sqs2')
->class(SqsTransport::class)
->factory([SqsTransport::class, 'ofDsn'])
->arg('$dsnString', '%env(SQS_DSN)%&queue=core_example_name2');
Transport Groups
Transport groups allow you to logically group multiple transports together. This is useful when you want external messages marked for one transport name to be consumable by multiple actual transports.
For example, if you have an #[ExternalIn('example_group', 'SomeEvent')] attribute on a message, it can be consumed from both example_name_for_transport and example_name_for_transport2 transports.
Configuration example:
'transport_groups' => [
'example_group' => ['example_name_for_transport', 'example_name_for_transport2'],
'another_group' => ['memory', 'external'],
],
This maps group names to arrays of transport names that belong to that group.