使用PhpAmqpLib常用的2种连接rabbitmq的方式

#connect to AMQP broker at example.com
use PhpAmqpLib\Connection\AMQPStreamConnection;
$amqp = new AMQPStreamConnection('example.com', 5672, 'user', 'pwd','/host');

#SSL or secure connection
use phpAmqpLib\Connection\AMQSSLConnection;
$amqp = new AMQPSSLConnection('domain', 5671, 'user', 'pwd','/host',['dsn'=>'amqps:']);
posted @ 2023-06-24 15:48  sblack  阅读(104)  评论(0编辑  收藏  举报