使用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:']);
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:']);
PHP中常见的问题点,知识点,及盲点。