本文整理汇总了C#中QueueManager.CreateQueues方法的典型用法代码示例。如果您正苦于以下问题:C# QueueManager.CreateQueues方法的具体用法?C# QueueManager.CreateQueues怎么用?C# QueueManager.CreateQueues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueueManager
的用法示例。
在下文中一共展示了QueueManager.CreateQueues方法的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(new IPEndPoint(IPAddress.Loopback, 23456), "test.esent");
queueManager.CreateQueues("h");
}
示例3: ReceivingFromRhinoQueue
public ReceivingFromRhinoQueue()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_queueManager = new QueueManager("localhost", "test.esent");
_queueManager.CreateQueues("h");
_queueManager.Start();
}
示例4: WhenPeekingMessages
public WhenPeekingMessages()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_queueManager = new QueueManager("localhost", "test.esent");
_queueManager.CreateQueues("h");
_queueManager.Start();
}
示例5: QueueIsAsync
public QueueIsAsync()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
_queueManager = new QueueManager("localhost", "test.esent");
_queueManager.CreateQueues("h");
_queueManager.Start();
}
示例6: WhenPeekingMessages
public WhenPeekingMessages()
{
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();
}
示例7: QueueManager
public static QueueManager QueueManager(string name = "test", string queue = "h")
{
var directory = string.Format("{0}.esent", name);
if (Directory.Exists(directory))
Directory.Delete(directory, true);
var queueManager = new QueueManager("localhost", directory);
queueManager.CreateQueues(queue);
return queueManager;
}
示例8: ReceivingFromRhinoQueue
public ReceivingFromRhinoQueue()
{
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();
}
示例9: QueueManager
public static QueueManager QueueManager(string name = "test", int port = 23456, string queue = "h")
{
var directory = string.Format("{0}.esent", name);
if (Directory.Exists(directory))
Directory.Delete(directory, true);
var queueManager = new QueueManager(new IPEndPoint(IPAddress.Loopback, port), directory);
queueManager.CreateQueues(queue);
return queueManager;
}
示例10: QueueManager
public static QueueManager QueueManager(string name = "test", int port = 23456, string queue = "h", bool delete = true, ILogger logger = null)
{
var directory = string.Format("{0}.esent", name);
if (delete && Directory.Exists(directory))
Directory.Delete(directory, true);
var queueManager = new QueueManager(new IPEndPoint(IPAddress.Loopback, port), directory, new QueueManagerConfiguration(), logger);
queueManager.CreateQueues(queue);
return queueManager;
}
示例11: UsingSubQueues
public UsingSubQueues()
{
if (Directory.Exists("test.esent"))
Directory.Delete("test.esent", true);
if (Directory.Exists("test2.esent"))
Directory.Delete("test2.esent", true);
sender = new QueueManager(new IPEndPoint(IPAddress.Loopback, 23456), "test.esent");
receiver = new QueueManager(new IPEndPoint(IPAddress.Loopback, 23457), "test2.esent");
receiver.CreateQueues("h", "a");
}
示例12: 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();
}
示例13: 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();
}
}
示例14: 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(new IPEndPoint(IPAddress.Loopback, 4545), "receiver.esent");
receiver.CreateQueues("uno");
tx.Complete();
}
}
示例15: MessageSent_EventIsRaised
public void MessageSent_EventIsRaised()
{
using(var sender = SetupSender())
{
sender.MessageSent += RecordMessageEvent;
using (var receiver = new QueueManager(new IPEndPoint(IPAddress.Loopback, 23457), TEST_QUEUE_2))
{
receiver.CreateQueues("h");
receiver.Start();
using (var tx = new TransactionScope())
{
sender.Send(
new Uri("rhino.queues://localhost:23457/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.Host);
Assert.Equal(23457, messageEventArgs.Endpoint.Port);
Assert.Equal("h", messageEventArgs.Message.Queue);
}