Closed
Description
Description
It would be very useful to have a routing key in custom messenger incoming data. Currently, there is no way to map message to type on the base on routing key
Example
class CustomSerializer implements SerializerInterface
{
public function decode(array $encodedEnvelope): Envelope
{
$body = $encodedEnvelope['body'];
$headers = $encodedEnvelope['headers'];
$extra = $encodedEnvelope['extra'];
$routingKey = $extra->routingKey;
switch($routingKey)
{
case 'blah':
$message = new Type1($body)...
}
.....
}
}