/// <summary>
        /// Specify a custom subscription storage for the bus instance
        /// </summary>
        /// <param name="subscriptionStorageFactory">Factory method for the subscription storage</param>
        public static void UseSubscriptionStorage(this ServiceBusConfigurator configurator,
            Func<SubscriptionStorage> subscriptionStorageFactory)
        {
            var builderConfigurator = new SubscriptionRouterBuilderConfiguratorImpl(
                x => x.UseSubscriptionStorage(subscriptionStorageFactory));

            configurator.AddSubscriptionRouterConfigurator(builderConfigurator);
        }
Example #2
0
        /// <summary>
        /// Specify a custom subscription storage for the bus instance
        /// </summary>
        /// <param name="subscriptionStorageFactory">Factory method for the subscription storage</param>
        public static void UseSubscriptionStorage(this ServiceBusConfigurator configurator,
                                                  Func <SubscriptionStorage> subscriptionStorageFactory)
        {
            var builderConfigurator = new SubscriptionRouterBuilderConfiguratorImpl(
                x => x.UseSubscriptionStorage(subscriptionStorageFactory));

            configurator.AddSubscriptionRouterConfigurator(builderConfigurator);
        }
        public static void AddSubscriptionObserver(this ServiceBusConfigurator configurator,
            Func<IServiceBus, SubscriptionRouter, SubscriptionObserver>
                observerFactory)
        {
            var coordinatorConfigurator =
                new SubscriptionRouterBuilderConfiguratorImpl(x => { x.AddObserverFactory(observerFactory); });

            configurator.AddSubscriptionRouterConfigurator(coordinatorConfigurator);
        }
        public static void AddSubscriptionObserver(this ServiceBusConfigurator configurator,
                                                   Func <IServiceBus, SubscriptionRouter, SubscriptionObserver>
                                                   observerFactory)
        {
            var coordinatorConfigurator =
                new SubscriptionRouterBuilderConfiguratorImpl(x => { x.AddObserverFactory(observerFactory); });

            configurator.AddSubscriptionCoordinatorConfigurator(coordinatorConfigurator);
        }
        /// <summary>
        /// Specify subscription storage for the bus instance using NHibernate
        /// </summary>
        /// <param name="sessionFactory">The session factory for the storage</param>
        public static void UseNHibernateSubscriptionStorage(this ServiceBusConfigurator configurator,
                                                            ISessionFactory sessionFactory)
        {
            Func <SubscriptionStorage> factoryMethod = () => new NHibernateSubscriptionStorage(sessionFactory);

            var builderConfigurator = new SubscriptionRouterBuilderConfiguratorImpl(
                x => x.UseSubscriptionStorage(factoryMethod));

            configurator.AddSubscriptionRouterConfigurator(builderConfigurator);
        }
        /// <summary>
        /// Specify subscription storage for the bus instance using NHibernate
        /// </summary>
        /// <param name="sessionFactory">The session factory for the storage</param>
        public static void UseNHibernateSubscriptionStorage(this ServiceBusConfigurator configurator,
            ISessionFactory sessionFactory)
        {
            Func<SubscriptionStorage> factoryMethod = () => new NHibernateSubscriptionStorage(sessionFactory);

            var builderConfigurator = new SubscriptionRouterBuilderConfiguratorImpl(
                x => x.UseSubscriptionStorage(factoryMethod));

            configurator.AddSubscriptionRouterConfigurator(builderConfigurator);
        }
        public static void UseSubscriptionService(this ServiceBusConfigurator configurator,
                                                  Action <SubscriptionClientConfigurator> configureCallback)
        {
            var clientConfigurator = new SubscriptionClientConfiguratorImpl();

            configureCallback(clientConfigurator);

            var routerBuilderConfigurator = new SubscriptionRouterBuilderConfiguratorImpl(x => x.SetNetwork(null));

            configurator.AddSubscriptionRouterConfigurator(routerBuilderConfigurator);

            configurator.AddSubscriptionObserver(clientConfigurator.Create);
        }
        public static void UseSubscriptionService(this ServiceBusConfigurator configurator,
            Action<SubscriptionClientConfigurator> configureCallback)
        {
            var clientConfigurator = new SubscriptionClientConfiguratorImpl();

            configureCallback(clientConfigurator);

            var routerBuilderConfigurator = new SubscriptionRouterBuilderConfiguratorImpl(x => x.SetNetwork(null));

            configurator.AddSubscriptionRouterConfigurator(routerBuilderConfigurator);

            configurator.AddSubscriptionObserver(clientConfigurator.Create);
        }