Example #1
0
            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();
            }
Example #2
0
 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);
     }
 }
Example #3
0
            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);
                }
            }
Example #4
0
 public void LogFailedMessage(NsqSharp.IMessage message)
 {
 }