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