0
0

RabbitMqBase.php 662 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace components;
  3. use PhpAmqpLib\Message\AMQPMessage;
  4. use PhpAmqpLib\Connection\AMQPStreamConnection;
  5. class RabbitMqBase {
  6. public function __construct(){
  7. include_once('RabbitMqServer.php');
  8. }
  9. public static function setRabbitMq($message,$k_route = 'operate-log',$e_name=''){
  10. $rabbitObj = new RabbitMqServer();
  11. $rabbitObj->setRabbit($message,$k_route,$e_name);//设置列队
  12. }
  13. public static function getRabbitMq($k_route = 'operate-log',$e_name='' ){
  14. $rabbitObj = new RabbitMqServer();
  15. $getRabObj = $rabbitObj->getRabbit($k_route,$e_name);//获取列队
  16. return $getRabObj;
  17. }
  18. }