Browse Source

小改

master
邝卫东 3 years ago
parent
commit
baad124992
2 changed files with 1 additions and 19 deletions
  1. +0
    -18
      AmqpTest/Amqp/AmqpSubscribe.cs
  2. +1
    -1
      AmqpTest/appsettings.test.json

+ 0
- 18
AmqpTest/Amqp/AmqpSubscribe.cs View File

@@ -115,8 +115,6 @@ namespace AmqpTest.Amqp
int count = 0; int count = 0;
var sw = new Stopwatch(); var sw = new Stopwatch();
sw.Start(); sw.Start();
//var tasks = new List<Task>();
//receiver.SetCredit(10000, false);


//只是控制该线程不退出 //只是控制该线程不退出
while (true) while (true)
@@ -133,22 +131,6 @@ namespace AmqpTest.Amqp
count++; count++;
}); });



//var message = await receiver.ReceiveAsync(new TimeSpan(0, 0, 5));
//if (message != null)
//{
// var messageId = message.ApplicationProperties["messageId"].ToString();
// var topic = message.ApplicationProperties["topic"].ToString();
// var body = Encoding.UTF8.GetString((byte[])message.Body);

// _logger.LogInformation($"message arrived, topic= {topic}, messageId= {messageId}, body= {body}");

// receiver.Accept(message);

// count++;
//}


if (sw.ElapsedMilliseconds > 60000) if (sw.ElapsedMilliseconds > 60000)
{ {
_logger.LogWarning($"约1分钟处理 {count} 个请求"); _logger.LogWarning($"约1分钟处理 {count} 个请求");


+ 1
- 1
AmqpTest/appsettings.test.json View File

@@ -4,7 +4,7 @@
"AccessKey": "LTAI4FdXhwy1evoHXingMaiZ", "AccessKey": "LTAI4FdXhwy1evoHXingMaiZ",
"AccessSecret": "CGmGpzta6ro8Bta4RLiQD18EF8m6Bm", "AccessSecret": "CGmGpzta6ro8Bta4RLiQD18EF8m6Bm",
"iotInstanceId": "iot-cn-nif1vosz501", "iotInstanceId": "iot-cn-nif1vosz501",
"ConsumerGroupId": "eQVdFouKAYajil208F7F000100",
"ConsumerGroupId": "0ZQFQv0QreC7WALTEWad000100",
"RegionId": "cn-shanghai", "RegionId": "cn-shanghai",
"ProductKey": "a18mXM6Cvx8", "ProductKey": "a18mXM6Cvx8",
"UId": "1111649216405698", "UId": "1111649216405698",


Loading…
Cancel
Save