public void HandleMessage(NsqSharp.IMessage message) { (var body, var correlationId) = GetFromMessageBody(message.Body); Try.Do(message.Finish, false); var rMsg = ReceivedMessages.GetOrAdd(correlationId, cId => new NSQueueMessage()); rMsg.Body = body; rMsg.WaitHandler.Set(); }
public void HandleMessage(NsqSharp.IMessage message) { Core.Log.LibVerbose("Message received"); try { (var body, var correlationId) = NSQueueClient.GetFromMessageBody(message.Body); var rMsg = new NSQMessage { CorrelationId = correlationId, Body = body }; Task.Run(() => _listener.EnqueueMessageToProcessAsync(_listener.ProcessingTaskAsync, rMsg)); Try.Do(message.Finish, false); } catch (Exception ex) { Core.Log.Write(ex); } }
public void HandleMessage(NsqSharp.IMessage message) { Core.Log.LibVerbose("Message received"); try { #if COMPATIBILITY Task.Run(() => _listener.EnqueueMessageToProcessAsync(_listener.ProcessingTaskAsync, message.Body)); #else ThreadPool.QueueUserWorkItem(async item => { await _listener.EnqueueMessageToProcessAsync(_listener.ProcessingTaskAsync, item); }, message.Body, false); #endif message.Finish(); } catch (Exception ex) { Core.Log.Write(ex); } }
public void LogFailedMessage(NsqSharp.IMessage message) { }