sroze / messenger-enqueue-transport

Uses Enqueue with Symfony's Messenger component.
MIT License
191 stars 55 forks source link

Amazon SQS FIFO queues #40

Closed PetarFedorovsky closed 5 years ago

PetarFedorovsky commented 5 years ago

Hi,

when sending messages to FIFO queues parameter MessageGroupId is required.

How to configure transport for .fifo queue? enqueue.yaml

enqueue:
    default:
        transport:  "%env(ENQUEUE_DSN)%"
        client: ~

messenger.yaml

framework:
    messenger:
        transports:
            sqs: enqueue://default?&topic[name]=test.fifo&queue[name]=test.fifo&receiveTimeout=3

        routing:
            'App\Message\Message': sqs

Tnx.

PetarFedorovsky commented 5 years ago

@makasim ,@drgomesp

AlexStansfield commented 5 years ago

Unfortunately not supported.

volkyeth commented 5 years ago

@PetarFedorovsky actually you can make it work by injecting both the groupId and messageDeduplicationId with a Messenger Middleware and a TransportConfiguration stamp

catharsisjelly commented 5 years ago

I've been trying to get this working over the last day or so and wanted just to give anyone else some code which I have now got talking to a FIFO SQS.

$this->messageBus->dispatch(
    (new Envelope(new TestMessage()))->with(
        new TransportConfiguration([
            'metadata' => [
                'MessageGroupId' => 'MyGroup'
            ]
        ])
    )
 );
PetarFedorovsky commented 5 years ago

@PetarFedorovsky actually you can make it work by injecting both the groupId and messageDeduplicationId with a Messenger Middleware and a TransportConfiguration stamp

Interesting approach, probably solves the problem, but i think it is something that should be supported trough configuration, not by creating unnecessary middleware. I have dropped FIFO queues and went with standard.