Skip to content

[Messenger] Batch send for SQS #60748

Open
@ehsanfa

Description

@ehsanfa

Description

The current SenderInterface::send() method in Symfony Messenger only supports sending one Envelope at a time. When using Amazon SQS as the transport, this results in one HTTP request per message.

Since AWS charges per request, this behavior becomes inefficient and costly at scale. Amazon SQS supports sending up to 10 messages in a single batch via the SendMessageBatch API, which significantly reduces the number of requests and cost.

It would be beneficial if Messenger could support batching messages when sending to SQS

Example

interface BatchSenderInterface
{
    /**
     * @param Envelope[] $envelopes
     * @return Envelope[]
     */
    public function sendBatch(array $envelopes): array;
}
if ($transport instanceof BatchSenderInterface) {
    $transport->sendBatch($envelopes);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy