Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

symfony/amqp-messenger v7.0.3

Symfony AMQP extension Messenger Bridge
Package summary
Share
0
issues
0
licenses
Package created
28 Jan 2020
Version published
23 Jan 2024
Maintainers
1
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does symfony/amqp-messenger do?

Symfony's AMQP Messenger offers seamless Advanced Message Queuing Protocol (AMQP) integration for the Symfony Messenger. In the world of distributed microservices, handling communication between them becomes a vital aspect, and messaging services like AMQP provide a common platform for these microservices to talk to each other. Symfony's AMQP messenger leverages this by providing a way to send and receive messages through AMQP directly from your Symfony applications.

How do you use symfony/amqp-messenger?

To effectively utilize Symfony's AMQP Messenger, you first need to install it using Composer, by running composer require symfony/amqp-messenger. After that, it's about configuring your Symfony application to actually make use of the AMQP services. You will need to configure your messenger.yaml file and include AMQP as a transport mechanism. Here's a basic example of how you can configure it:

# config/packages/messenger.yaml
framework:
    messenger:
        transports:
            amqp: "%env(MESSENGER_TRANSPORT_DSN)%"
        routing:
            'App\Message\YourMessage': amqp

In this configuration, App\Message\YourMessage is your custom message class that you desire to send through AMQP. Make sure to replace %env(MESSENGER_TRANSPORT_DSN)% with the appropriate DSN for your AMQP service.

Once you've done this, in your application's code, you can dispatch your messages as follows:

use App\Message\YourMessage;
use Symfony\Component\Messenger\MessageBusInterface;

class YourClass
{
    private $bus;

    public function __construct(MessageBusInterface $bus)
    {
        $this->bus = $bus;
    }

    public function yourMethod()
    {
        // Your business logic here...

        // Create and dispatch YourMessage
        $this->bus->dispatch(new YourMessage($yourData));
    }
}

Where are the symfony/amqp-messenger docs?

The documentation for Symfony's AMQP Messenger can be found at the Symfony documentation website. Please note that issues related to this package are reported at the main Symfony repository and to contribute or send pull requests you should also target the main Symfony repository.