public void Consume(Do message)
            {
                if (string.IsNullOrEmpty(message.Id))
                {
                    var container = _root.GetContainer("test1");
                    container.Create();
                    container.GetItem("data").Write(s =>
                    {
                        using (var writer = new StreamWriter(s, Encoding.UTF8))
                        {
                            writer.Write(new string('*', 50000));
                        }
                    });

                    _sender.SendOne(new Do {
                        Id = "test1"
                    });
                    return;
                }
                string result = null;

                _root.GetContainer(message.Id).GetItem("data").ReadInto((props, stream) =>
                {
                    using (var reader = new StreamReader(stream, Encoding.UTF8))
                    {
                        result = reader.ReadToEnd();
                    }
                });
                Assert.AreEqual(new string('*', 50000), result);
                _sender.SendOne(new Finish(), cb => cb.AddString("finish"));
            }
예제 #2
0
 public SampleQuarantine(IStreamingRoot streamingRoot)
 {
     streamingRoot.GetContainer("sample-04-errors").Create();
 }
예제 #3
0
 public MailQuarantine(SmtpHandlerCore core, IStreamingRoot root)
 {
     _core = core;
     _container = root.GetContainer("sample-errors").Create();
 }
예제 #4
0
 public MailQuarantine(SmtpHandlerCore core, IStreamingRoot root)
 {
     _core      = core;
     _container = root.GetContainer("sample-errors").Create();
 }
예제 #5
0
 public Quarantine(IStreamingRoot root)
 {
     _container = root.GetContainer(IdFor.ErrorBlob).Create();
 }