|
@@ -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} 个请求"); |
|
|