/// <summary> /// Starts a ServiceBus listener, that triggers (with debounce) a sitemap regeneration on ProductUpdateEvent. /// </summary> private static void StartServiceBusListener() { ServiceBusListener.Register(new CommonEventMessageProcessor { EventName = "ProductUpdatedEvent", Action = SitemapGeneratorScheduler.RegenerateSitemapJob }); ServiceBusListener.Start(); }
public static void Initialize() { ServiceBusListener.Register(new CommonEventMessageProcessor() { EventName = "ProductUpdatedEvent", Action = SitemapGeneratorScheduler.RegenerateSitemapJob }); ServiceBusListener.Start(); DataEvents <IPage> .OnAfterAdd += new DataEventHandler(SitemapUpdateAfterPageChanged); DataEvents <IPage> .OnDeleted += new DataEventHandler(SitemapUpdateAfterPageChanged); foreach (var typeFullName in _dataTypesToIncludeFromConfig) { var type = Type.GetType(typeFullName); if (type == null) { continue; } DataEventSystemFacade.SubscribeToDataAfterAdd(type, SitemapUpdateAfterPageChanged, true); DataEventSystemFacade.SubscribeToDataDeleted(type, SitemapUpdateAfterPageChanged, true); } }