本文整理汇总了C#中QueueManager.Start方法的典型用法代码示例。如果您正苦于以下问题:C# QueueManager.Start方法的具体用法?C# QueueManager.Start怎么用?C# QueueManager.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueueManager
的用法示例。
在下文中一共展示了QueueManager.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MessageSent_EventIsRaised
public void MessageSent_EventIsRaised()
{
using (var sender = SetupSender())
{
sender.MessageSent += RecordMessageEvent;
using (var receiver = new QueueManager("localhost", "test2.esent"))
{
receiver.CreateQueues("h");
receiver.Start();
using (var tx = new TransactionScope())
{
sender.Send(
new Uri("file://localhost/h"),
new MessagePayload
{
Data = new byte[] { 1, 2, 4, 5 }
});
tx.Complete();
}
sender.WaitForAllMessagesToBeSent();
}
sender.MessageSent -= RecordMessageEvent;
}
Assert.NotNull(_messageEventArgs);
Assert.Equal("localhost", _messageEventArgs.Endpoint);
Assert.Equal("h", _messageEventArgs.Message.Queue);
}
示例2: QueueIsAsync
public QueueIsAsync()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_queueManager = new QueueManager("localhost", "test.esent");
_queueManager.CreateQueues("h");
_queueManager.Start();
}
示例3: Errors
public Errors()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_sender = new QueueManager(null, "test.esent");
_sender.Start();
}
示例4: Start
public bool Start(HostControl hostControl)
{
_logger.Info("Producer service starting");
_queueManager = new QueueManager(_queueName, _svcBusConnection);
_queueManager.Start().Wait();
_task = StartProducing();
return true;
}
示例5: WhenPeekingMessages
public WhenPeekingMessages()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_queueManager = new QueueManager("localhost", "test.esent");
_queueManager.CreateQueues("h");
_queueManager.Start();
}
示例6: ReceivingFromRhinoQueue
public ReceivingFromRhinoQueue()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_queueManager = new QueueManager("localhost", "test.esent");
_queueManager.CreateQueues("h");
_queueManager.Start();
}
示例7: Errors
public Errors()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
sender = new QueueManager(new IPEndPoint(IPAddress.Loopback, 23456), "test.esent");
sender.Start();
}
示例8: Enabling_performance_counters_after_queue_has_started_should_throw
public void Enabling_performance_counters_after_queue_has_started_should_throw()
{
Setup();
using (var queueManager = new QueueManager("localhost", TEST_QUEUE_1))
{
queueManager.Start();
Assert.Throws<InvalidOperationException>(() => queueManager.EnablePerformanceCounters());
}
}
示例9: QueueIsAsync
public QueueIsAsync()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
queueManager = new QueueManager(new IPEndPoint(IPAddress.Loopback, 23456), "test.esent");
queueManager.CreateQueues("h");
queueManager.Start();
}
示例10: Setup
public void Setup()
{
using (var tx = new TransactionScope())
{
receiver = ObjectMother.QueueManager("receiver", 4545, "uno");
receiver.Start();
tx.Complete();
}
}
示例11: Enabling_performance_counters_after_queue_has_started_should_throw
public void Enabling_performance_counters_after_queue_has_started_should_throw()
{
Setup();
using (var queueManager = new QueueManager(new IPEndPoint(IPAddress.Loopback, 23456), TEST_QUEUE_1))
{
queueManager.Start();
Assert.Throws<InvalidOperationException>(() => queueManager.EnablePerformanceCounters());
}
}
示例12: Start
public bool Start(HostControl hostControl)
{
_logger.Info("Subscriber service starting");
_queueManager = new QueueManager(_queueName, _svcBusConnection);
_queueManager.Start().Wait();
var cloudTableClient = _storageAccount.CreateCloudTableClient();
_tableRef = cloudTableClient.GetTableReference("MessageData");
_tableRef.CreateIfNotExists();
_task = StartConsuming();
return true;
}
示例13: SendingToRhinoQueue
public SendingToRhinoQueue()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
if (Directory.Exists("test2.esent"))
Directory.Delete("test2.esent", true);
_sender = new QueueManager(null, "test.esent");
_sender.Start();
_receiver = new QueueManager("localhost", "test2.esent");
_receiver.CreateQueues("h", "a");
_receiver.Start();
}
示例14: should_add_new_cars_to_the_manager_after_it_is_started
public void should_add_new_cars_to_the_manager_after_it_is_started()
{
// Arrange
target = new QueueManager(messageProcessorFactory);
target.Init(listOfCars, 1);
// Act
target.Start();
target.AddCar(new Car());
// Assert
Assert.AreEqual(3, target.ProcessorCount);
}
示例15: FromRene
public FromRene()
{
if (Directory.Exists("receiver.esent"))
Directory.Delete("receiver.esent", true);
if (Directory.Exists("sender.esent"))
Directory.Delete("sender.esent", true);
using (var tx = new TransactionScope())
{
_receiver = new QueueManager("localhost", "receiver.esent");
_receiver.CreateQueues("uno");
_receiver.Start();
tx.Complete();
}
}