当前位置: 首页>>代码示例>>C#>>正文


C# IQueueManager.EnsureSubscriptionExists方法代码示例

本文整理汇总了C#中IQueueManager.EnsureSubscriptionExists方法的典型用法代码示例。如果您正苦于以下问题:C# IQueueManager.EnsureSubscriptionExists方法的具体用法?C# IQueueManager.EnsureSubscriptionExists怎么用?C# IQueueManager.EnsureSubscriptionExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IQueueManager的用法示例。


在下文中一共展示了IQueueManager.EnsureSubscriptionExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCompetingEventMessagePumps

        private static void CreateCompetingEventMessagePumps(BusBuilderConfiguration configuration,
                                                             IQueueManager queueManager,
                                                             MessagingFactory messagingFactory,
                                                             ICollection<IMessagePump> messagePumps)
        {
            var eventTypes = configuration.CompetingEventHandlerTypes.SelectMany(ht => ht.GetGenericInterfacesClosing(typeof (IHandleCompetingEvent<>)))
                                          .Select(gi => gi.GetGenericArguments().Single())
                                          .OrderBy(t => t.FullName)
                                          .Distinct()
                                          .ToArray();

            foreach (var eventType in eventTypes)
            {
                var applicationSharedSubscriptionName = String.Format("{0}", configuration.ApplicationName);
                queueManager.EnsureSubscriptionExists(eventType, applicationSharedSubscriptionName);
                var pump = new CompetingEventMessagePump(messagingFactory, configuration.CompetingEventBroker, eventType, applicationSharedSubscriptionName, configuration.Logger);
                messagePumps.Add(pump);
            }
        }
开发者ID:nblumhardt,项目名称:Nimbus,代码行数:19,代码来源:BusBuilder.cs

示例2: CreateMulticastEventMessagePumps

        private static void CreateMulticastEventMessagePumps(BusBuilderConfiguration configuration,
                                                             IQueueManager queueManager,
                                                             MessagingFactory messagingFactory,
                                                             ICollection<IMessagePump> messagePumps,
                                                             ILogger logger)
        {
            logger.Debug("Creating multicast event message pumps");

            var eventTypes = configuration.MulticastEventHandlerTypes.SelectMany(ht => ht.GetGenericInterfacesClosing(typeof (IHandleMulticastEvent<>)))
                                          .Select(gi => gi.GetGenericArguments().Single())
                                          .OrderBy(t => t.FullName)
                                          .Distinct()
                                          .ToArray();

            foreach (var eventType in eventTypes)
            {
                logger.Debug("Registering Message Pump for Event type {0}", eventType.Name);

                var myInstanceSubscriptionName = String.Format("{0}.{1}", configuration.InstanceName, configuration.ApplicationName);
                queueManager.EnsureSubscriptionExists(eventType, myInstanceSubscriptionName);
                var pump = new MulticastEventMessagePump(messagingFactory, configuration.MulticastEventBroker, eventType, myInstanceSubscriptionName, configuration.Logger, configuration.DefaultBatchSize);
                messagePumps.Add(pump);
            }
        }
开发者ID:nhuhuynh,项目名称:Nimbus,代码行数:24,代码来源:BusBuilder.cs


注:本文中的IQueueManager.EnsureSubscriptionExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。