php-amqplib包中PhpAmqpLib\Channel\AMQPChannel,$ticket变量是什么作用
https://github.com/php-amqpli...
/**
* Declares queue, creates if needed
*
* @param string $queue
* @param bool $passive
* @param bool $durable
* @param bool $exclusive
* @param bool $auto_delete
* @param bool $nowait
* @param array|AMQPTable $arguments
* @param int|null $ticket
* @return array|null
*@throws \PhpAmqpLib\Exception\AMQPTimeoutException if the specified operation timeout was exceeded
*/
public function queue_declare(
$queue = '',
$passive = false,
$durable = false,
$exclusive = false,
$auto_delete = true,
$nowait = false,
$arguments = array(),
$ticket = null
)
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
// 参数 $ticket 最后一个,请问它的作用是什么
$channel->queue_declare(queue:'hello', passive:false, durable:false, exclusive:false, auto_delete:false, nowait:flase, arguments:false, ticket:null);
$msg = new AMQPMessage('Hello World!');
$channel->basic_publish($msg, '', 'hello');
echo " [x] Sent 'Hello World!'\n";
$channel->close();
$connection->close();
namespace PhpAmqpLib\Channel
; class AMQPChannel
.
方法:queue_declare($ticket = null)
,queue_bind
,exchange_declare
,exchange_unbind
等这些方法都有参数$ticket,请问$ticket的作用是什么
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就 RabbitMQ 而言,这好像是一个已经被遗弃的参数用来向前兼容的。