php-enqueue/enqueue-dev

Symfony RPC

tkowalski29 opened this issue · 1 comments

Hi,

I have a problem with replay feedback.
Producer creates a temporary queue and sends a message to it.
Unfortunately, the consumer cannot read it and does not return any error. The only error there is is the timeout.

Producer:
public function reply(Message $message): void { if ($this->message->getReplyTo()) { $queue = $this->context->createQueue($this->message->getReplyTo()); $this->context->createProducer()->send($queue, $message); } }

Consumer:
`
try {
$command = (new Sync(999));

        $return = $this->producer->sendCommand($command->type(), $command->data()->sendMessage(), true); 
    } catch (Exception $e) {
        var_dump($e->getMessage());exit;
    }

    $r = $return->receive(60000);
    var_dump($r->getBody());

`

Does anyone have an example of how to configure this?

solution.

an identical CorrelationId is needed

if ($this->message->getReplyTo()) {
            $queue = $this->context->createQueue($this->message->getReplyTo());

            $newMessage->setCorrelationId($this->message->getCorrelationId());
            $this->context->createProducer()->send($queue, $newMessage);
        }