composer
This commit is contained in:
parent
c519d5d8ea
commit
ae24fea621
|
|
@ -7,13 +7,13 @@ require_once __DIR__ . '/../support/bootstrap.php';
|
||||||
use PhpAmqpLib\Connection\AMQPStreamConnection;
|
use PhpAmqpLib\Connection\AMQPStreamConnection;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
use Webman\RedisQueue\Redis;
|
use Webman\RedisQueue\Redis;
|
||||||
|
|
||||||
// 申请新短信模版/营销短信发送
|
// 申请新短信模版/营销短信发送
|
||||||
$host = config('cons.mq.host');
|
$host = config('cons.mq.host');
|
||||||
$port = config('cons.mq.port');
|
$port = config('cons.mq.port');
|
||||||
$user = config('cons.mq.user');
|
$user = config('cons.mq.user');
|
||||||
$password = config('cons.mq.password');
|
$password = config('cons.mq.password');
|
||||||
$queue = config('cons.mq.queue_t') . '-apply.sms.temp';
|
$queue = config('cons.mq.queue_t') . '-apply.sms.temp';
|
||||||
|
define('AMQP_DEBUG', true);
|
||||||
|
|
||||||
// 防止空闲时间断线必须设置心跳
|
// 防止空闲时间断线必须设置心跳
|
||||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||||
|
|
@ -57,6 +57,7 @@ use Webman\RedisQueue\Redis;
|
||||||
};
|
};
|
||||||
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
||||||
while ($rabbit_channel->is_consuming()) {
|
while ($rabbit_channel->is_consuming()) {
|
||||||
|
Log::info('apply.sms.temp-MQ准备调用wait');
|
||||||
$rabbit_channel->wait();
|
$rabbit_channel->wait();
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use support\Log;
|
||||||
use Webman\RedisQueue\Redis;
|
use Webman\RedisQueue\Redis;
|
||||||
|
|
||||||
// 生日有礼
|
// 生日有礼
|
||||||
|
define('AMQP_DEBUG', true);
|
||||||
$host = config('cons.mq.host');
|
$host = config('cons.mq.host');
|
||||||
$port = config('cons.mq.port');
|
$port = config('cons.mq.port');
|
||||||
$user = config('cons.mq.user');
|
$user = config('cons.mq.user');
|
||||||
|
|
@ -43,6 +43,7 @@ use Webman\RedisQueue\Redis;
|
||||||
};
|
};
|
||||||
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
||||||
while ($rabbit_channel->is_consuming()) {
|
while ($rabbit_channel->is_consuming()) {
|
||||||
|
Log::info('birthday.gift.sms-MQ准备调用wait');
|
||||||
$rabbit_channel->wait();
|
$rabbit_channel->wait();
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ use support\Log;
|
||||||
$user = config('cons.mq.user');
|
$user = config('cons.mq.user');
|
||||||
$password = config('cons.mq.password');
|
$password = config('cons.mq.password');
|
||||||
$queue = config('cons.mq.queue_t') . '-order.print.queue';
|
$queue = config('cons.mq.queue_t') . '-order.print.queue';
|
||||||
|
define('AMQP_DEBUG', true);
|
||||||
// 防止空闲时间断线必须设置心跳
|
// 防止空闲时间断线必须设置心跳
|
||||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||||
'/',
|
'/',
|
||||||
|
|
@ -99,6 +99,7 @@ use support\Log;
|
||||||
};
|
};
|
||||||
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
||||||
while ($rabbit_channel->is_consuming()) {
|
while ($rabbit_channel->is_consuming()) {
|
||||||
|
Log::info('order.print.queue-MQ准备调用wait');
|
||||||
$rabbit_channel->wait();
|
$rabbit_channel->wait();
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use PhpAmqpLib\Connection\AMQPStreamConnection;
|
||||||
use support\think\Db;
|
use support\think\Db;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
|
|
||||||
|
define('AMQP_DEBUG', true);
|
||||||
$host = config('cons.mq.host');
|
$host = config('cons.mq.host');
|
||||||
$port = config('cons.mq.port');
|
$port = config('cons.mq.port');
|
||||||
$user = config('cons.mq.user');
|
$user = config('cons.mq.user');
|
||||||
|
|
@ -83,6 +83,7 @@ use support\Log;
|
||||||
};
|
};
|
||||||
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
$rabbit_channel->basic_consume($queue, '', false, false, false, false, $callback);
|
||||||
while ($rabbit_channel->is_consuming()) {
|
while ($rabbit_channel->is_consuming()) {
|
||||||
|
Log::info('product.info.change.queue-MQ准备调用wait');
|
||||||
$rabbit_channel->wait();
|
$rabbit_channel->wait();
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue