开发者

How do I set delivery_mode on message using php extension AMQP with RabbitMQ?

开发者 https://www.devze.com 2023-02-06 16:55 出处:网络
I\'ve set whole infrastructure meaning I\'ve configure php with AMQP extension http://www.php.net/manual/en/book.amqp.php. I\'ve set up durable exchange and queue. Now I know I should publish message

I've set whole infrastructure meaning I've configure php with AMQP extension http://www.php.net/manual/en/book.amqp.php. I've set up durable exchange and queue. Now I know I should publish message with delivery_mode = 2 (or equivalent to it in php) according to http://www.rabbitmq.com/tutorial-two-python.html. I don't know if I can do 开发者_StackOverflow社区that and if so I don't know how.


$message = new AMQPMessage(serialize($object), array('content_type' => 'text/plain', 'delivery_mode' => 2));

This is using http://code.google.com/p/php-amqplib/, but I guess the native extension has a similar syntax.


If you use my Amqp library you can use the documentation to get you started


Documentation was updated (on february 4th) and explains it all http://www.php.net/manual/en/amqpexchange.publish.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号