コード例 #1
0
		public static void SetReceivedMessage(this State<Pipeline> state, ReceivedMessage receivedMessage)
		{
			state.Replace(StateKeys.ReceivedMessage, receivedMessage);
		}
コード例 #2
0
ファイル: FileQueue.cs プロジェクト: hopla/shuttle-esb
        public ReceivedMessage GetMessage()
        {
            if (!_journalInitialized)
            {
                ReturnJournalMessages();
            }

            lock (_padlock)
            {
                var message = Directory.GetFiles(_queueFolder, ExtensionMask).OrderBy(file => new FileInfo(file).CreationTime).FirstOrDefault();

                if (string.IsNullOrEmpty(message))
                {
                    return null;
                }

                ReceivedMessage result;
                var acknowledgementToken = Path.GetFileName(message);

                using (var stream = File.OpenRead(message))
                {
                    result = new ReceivedMessage(stream.Copy(), acknowledgementToken);
                }

                File.Move(message, Path.Combine(_journalFolder, acknowledgementToken));

                return result;
            }
        }
コード例 #3
0
 public static void SetReceivedMessage(this State<ObservablePipeline> state, ReceivedMessage receivedMessage)
 {
     state.Replace(StateKeys.ReceivedMessage, receivedMessage);
 }