using HealthMonitor.Service.Resolver.Interface; using HealthMonitor.Service.Sub; using HealthMonitor.Service.Sub.Interface; using System.Collections.Concurrent; namespace HealthMonitor.WebApi { public class PackageProcess : IDisposable { private readonly ILogger _logger; private readonly MsgQueueManager _msgQueueManager; public PackageProcess(ILogger logger, MsgQueueManager msgQueueManager) { _logger = logger; _msgQueueManager = msgQueueManager; } public async Task ResolveAsync() { var resolver = _msgQueueManager.GetMsgResolver(); try { if (resolver != null) { await resolver.ExecuteMessageAsync().ConfigureAwait(false); } } catch (Exception ex) { _logger.LogError("未处理异常 message: {ex.Message}\n {ex.StackTrace}", ex.Message, ex.StackTrace); } return true; } public void Dispose() { throw new NotImplementedException(); } } }