debug
This commit is contained in:
parent
ae24fea621
commit
c5fab07c23
|
|
@ -13,8 +13,10 @@ use Webman\RedisQueue\Redis;
|
||||||
$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);
|
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
define('AMQP_DEBUG', true);
|
||||||
// 防止空闲时间断线必须设置心跳
|
// 防止空闲时间断线必须设置心跳
|
||||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||||
'/',
|
'/',
|
||||||
|
|
@ -29,9 +31,7 @@ use Webman\RedisQueue\Redis;
|
||||||
30
|
30
|
||||||
);
|
);
|
||||||
$rabbit_channel = $connection->channel();
|
$rabbit_channel = $connection->channel();
|
||||||
$rabbit_channel->queue_declare($queue, false, true, false, false, false, [
|
$rabbit_channel->queue_declare($queue, false, true, false, false);
|
||||||
// 'x-message-ttl' => ['I', 180000]
|
|
||||||
]);
|
|
||||||
|
|
||||||
$callback = function ($msg) use ($queue){
|
$callback = function ($msg) use ($queue){
|
||||||
$data = $msg->body;
|
$data = $msg->body;
|
||||||
|
|
@ -62,3 +62,8 @@ use Webman\RedisQueue\Redis;
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
$connection->close();
|
$connection->close();
|
||||||
|
}catch (Exception $exception) {
|
||||||
|
Log::info('apply.sms.temp-MQ错误' . $exception->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ use PhpAmqpLib\Connection\AMQPStreamConnection;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
use Webman\RedisQueue\Redis;
|
use Webman\RedisQueue\Redis;
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
// 生日有礼
|
// 生日有礼
|
||||||
define('AMQP_DEBUG', true);
|
define('AMQP_DEBUG', true);
|
||||||
$host = config('cons.mq.host');
|
$host = config('cons.mq.host');
|
||||||
|
|
@ -29,9 +31,7 @@ define('AMQP_DEBUG', true);
|
||||||
30
|
30
|
||||||
);
|
);
|
||||||
$rabbit_channel = $connection->channel();
|
$rabbit_channel = $connection->channel();
|
||||||
$rabbit_channel->queue_declare($queue, false, true, false, false, false, [
|
$rabbit_channel->queue_declare($queue, false, true, false, false);
|
||||||
// 'x-message-ttl' => ['I', 180000]
|
|
||||||
]);
|
|
||||||
|
|
||||||
$callback = function ($msg) use ($queue){
|
$callback = function ($msg) use ($queue){
|
||||||
$date_time = date('Y-m-d H:i:s');
|
$date_time = date('Y-m-d H:i:s');
|
||||||
|
|
@ -48,3 +48,7 @@ define('AMQP_DEBUG', true);
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
$connection->close();
|
$connection->close();
|
||||||
|
}catch (Exception $exception) {
|
||||||
|
Log::info('birthday.gift.sms-MQ错误' . $exception->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ 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';
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
define('AMQP_DEBUG', true);
|
define('AMQP_DEBUG', true);
|
||||||
// 防止空闲时间断线必须设置心跳
|
// 防止空闲时间断线必须设置心跳
|
||||||
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
$connection = new AMQPStreamConnection($host, $port, $user, $password,
|
||||||
|
|
@ -104,3 +107,8 @@ define('AMQP_DEBUG', true);
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
$connection->close();
|
$connection->close();
|
||||||
|
}catch (Exception $exception) {
|
||||||
|
Log::info('order.print.queue-MQ错误' . $exception->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use PhpAmqpLib\Connection\AMQPStreamConnection;
|
||||||
use support\think\Db;
|
use support\think\Db;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
|
|
||||||
|
try {
|
||||||
define('AMQP_DEBUG', true);
|
define('AMQP_DEBUG', true);
|
||||||
$host = config('cons.mq.host');
|
$host = config('cons.mq.host');
|
||||||
$port = config('cons.mq.port');
|
$port = config('cons.mq.port');
|
||||||
|
|
@ -28,9 +29,7 @@ define('AMQP_DEBUG', true);
|
||||||
30
|
30
|
||||||
);
|
);
|
||||||
$rabbit_channel = $connection->channel();
|
$rabbit_channel = $connection->channel();
|
||||||
$rabbit_channel->queue_declare($queue, false, true, false, false, false, [
|
$rabbit_channel->queue_declare($queue, false, true, false, false);
|
||||||
// 'x-message-ttl' => ['I', 180000]
|
|
||||||
]);
|
|
||||||
|
|
||||||
$callback = function ($msg) use ($queue){
|
$callback = function ($msg) use ($queue){
|
||||||
$date_time = date('Y-m-d H:i:s');
|
$date_time = date('Y-m-d H:i:s');
|
||||||
|
|
@ -88,3 +87,6 @@ define('AMQP_DEBUG', true);
|
||||||
}
|
}
|
||||||
$rabbit_channel->close();
|
$rabbit_channel->close();
|
||||||
$connection->close();
|
$connection->close();
|
||||||
|
}catch (Exception $exception) {
|
||||||
|
Log::info('product.info.change.queue-MQ错误' . $exception->getMessage());
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue