ssi-anik / amqp

php-amqplib wrapper that eases the consumption of RabbitMQ. A painless way of using RabbitMQ
https://packagist.org/packages/anik/amqp
MIT License
134 stars 23 forks source link

correlation_id and reply_to not working #20

Closed Stehos closed 2 years ago

Stehos commented 2 years ago

Hello, I would like to ask if the following piece of code is correct Snímka obrazovky 2021-09-19 o 12 48 55

I am trying to implement the following Snímka obrazovky 2021-09-19 o 12 50 34

It's working only in AMQP admin panel. I can see a published message in the exchange but I don't get response to queue called stefanTest.

Thank you for your help.

Stehos commented 2 years ago

I switched to another approach and it's working fine.

    $msg = new PublishableMessage('[[0, "xx.user.has-group", 771296, "admin"]]');
    $msg->setExchange(new Exchange('xx.rpc'));
    $msg->setProperties(['reply_to' => 'stefanTest', 'correlation_id' => 'stefanTest']);
    app('amqp')->publish($msg, 'json.x');