Skip to content

[Messenger] AMQP configuration and MessageBus::dispatch enhancements #29950

Closed
@bentcoder

Description

@bentcoder

AMQP configuration

Based on the current configuration options, we can define only one routing_key per queue with routing_key option. This could be improved to allow us to define multiple routing keys with routing_keys options. As we all know by now a queue bound to a topic or direct exchange can have more than one routing_key. This is how it would enhance things.

e.g.

framework:
    messenger:
        transports:
            amqp:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    ...
                    queue:
                        ...
                        routing_keys: ['key_1', 'key_2' ...]

MessageBus::dispatch

We should have a way of setting routing_key at MessageBus::dispatch() level. Whether it is via an Envelope or a Stamp.

e.g.

$bus->dispatch(
     new Envelop(
          new MyMessage(...),
          new RoutingKeyStamp('key_1')
     )
);
$bus->dispatch(
     (new Envelop(
          new MyMessage(...)
     ))
     ->with(new RoutingKeyStamp('key_1'));
);

Not as critical as the ones above for now but:

It would also be nice to see a:

  • Remote Procedure Call (RPC) feature which returns response/result back to MessageBus::dispatch(). This is obviously a synchronise call.
  • Dead-Letter Exchange feature

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions