From baad124992dce93cdee8a8d8130323eae49e3167 Mon Sep 17 00:00:00 2001 From: don Date: Wed, 24 Feb 2021 09:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AmqpTest/Amqp/AmqpSubscribe.cs | 18 ------------------ AmqpTest/appsettings.test.json | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/AmqpTest/Amqp/AmqpSubscribe.cs b/AmqpTest/Amqp/AmqpSubscribe.cs index f9ed129..424bf7c 100644 --- a/AmqpTest/Amqp/AmqpSubscribe.cs +++ b/AmqpTest/Amqp/AmqpSubscribe.cs @@ -115,8 +115,6 @@ namespace AmqpTest.Amqp int count = 0; var sw = new Stopwatch(); sw.Start(); - //var tasks = new List(); - //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} 个请求"); diff --git a/AmqpTest/appsettings.test.json b/AmqpTest/appsettings.test.json index fec6269..bf788f4 100644 --- a/AmqpTest/appsettings.test.json +++ b/AmqpTest/appsettings.test.json @@ -4,7 +4,7 @@ "AccessKey": "LTAI4FdXhwy1evoHXingMaiZ", "AccessSecret": "CGmGpzta6ro8Bta4RLiQD18EF8m6Bm", "iotInstanceId": "iot-cn-nif1vosz501", - "ConsumerGroupId": "eQVdFouKAYajil208F7F000100", + "ConsumerGroupId": "0ZQFQv0QreC7WALTEWad000100", "RegionId": "cn-shanghai", "ProductKey": "a18mXM6Cvx8", "UId": "1111649216405698",