How do I set delivery_mode on message using php extension AMQP with RabbitMQ?
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
精彩评论