邝卫东 3 lat temu
rodzic
commit
baad124992
2 zmienionych plików z 1 dodań i 19 usunięć
  1. +0
    -18
      AmqpTest/Amqp/AmqpSubscribe.cs
  2. +1
    -1
      AmqpTest/appsettings.test.json

+ 0
- 18
AmqpTest/Amqp/AmqpSubscribe.cs Wyświetl plik

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

//只是控制该线程不退出
while (true)
@@ -133,22 +131,6 @@ namespace AmqpTest.Amqp
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)
{
_logger.LogWarning($"约1分钟处理 {count} 个请求");


+ 1
- 1
AmqpTest/appsettings.test.json Wyświetl plik

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


Ładowanie…
Anuluj
Zapisz