本文整理汇总了C#中Configure.CreateQueues方法的典型用法代码示例。如果您正苦于以下问题:C# Configure.CreateQueues方法的具体用法?C# Configure.CreateQueues怎么用?C# Configure.CreateQueues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configure
的用法示例。
在下文中一共展示了Configure.CreateQueues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Install
public void Install(string identity, Configure config)
{
if (config.Settings.Get<bool>("Endpoint.SendOnly"))
{
return;
}
if (!config.CreateQueues())
{
return;
}
var wantQueueCreatedInstances = config.Builder.BuildAll<IWantQueueCreated>().ToList();
foreach (var wantQueueCreatedInstance in wantQueueCreatedInstances.Where(wantQueueCreatedInstance => wantQueueCreatedInstance.ShouldCreateQueue()))
{
if (wantQueueCreatedInstance.Address == null)
{
throw new InvalidOperationException(string.Format("IWantQueueCreated implementation {0} returned a null address", wantQueueCreatedInstance.GetType().FullName));
}
QueueCreator.CreateQueueIfNecessary(wantQueueCreatedInstance.Address, identity);
Logger.DebugFormat("Verified that the queue: [{0}] existed", wantQueueCreatedInstance.Address);
}
}
示例2: Install
public void Install(string identity, Configure config)
{
if (config.Settings.Get<bool>("Endpoint.SendOnly"))
{
return;
}
if (!config.CreateQueues())
{
return;
}
var satellites = config.Builder
.BuildAll<ISatellite>()
.ToList();
foreach (var satellite in satellites.Where(satellite => !satellite.Disabled && satellite.InputAddress != null))
{
QueueCreator.CreateQueueIfNecessary(satellite.InputAddress, identity);
}
}