Skip to content

Commit 95c3659

Browse files
committed
compatibility with 0.8x
1 parent 2e9fb0b commit 95c3659

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/enqueue/Client/RouterProcessor.php

+16
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
final class RouterProcessor implements Processor
1111
{
12+
/**
13+
* compatibility with 0.8x
14+
*/
15+
private const COMMAND_TOPIC_08X = '__command__';
16+
1217
/**
1318
* @var DriverInterface
1419
*/
@@ -21,6 +26,17 @@ public function __construct(DriverInterface $driver)
2126

2227
public function process(InteropMessage $message, Context $context): Result
2328
{
29+
// compatibility with 0.8x
30+
if (self::COMMAND_TOPIC_08X === $message->getProperty(Config::TOPIC)) {
31+
$clientMessage = $this->driver->createClientMessage($message);
32+
$clientMessage->setProperty(Config::TOPIC, null);
33+
34+
$this->driver->sendToProcessor($clientMessage);
35+
36+
return Result::ack('Legacy 0.8x message routed to processor');
37+
}
38+
// compatibility with 0.8x
39+
2440
if ($message->getProperty(Config::COMMAND)) {
2541
return Result::reject(sprintf(
2642
'Unexpected command "%s" got. Command must not go to the router.',

0 commit comments

Comments
 (0)