public ConfiguredFubuRegistry()
            {
                ServiceBus.EnableInMemoryTransport();

                Channel(x => x.Outbound).ReadIncoming(ByTasks(x => x.OutboundCount));
                Channel(x => x.Upstream).ReadIncoming(ByThreads(x => x.UpstreamCount));
            }
Ejemplo n.º 2
0
        public MonitoredNode(string nodeId, Uri incoming, IDocumentStore store)
        {
            Policies.Local.Add <ErrorHandlingPolicy>();

            AlterSettings <MonitoringSettings>(x => x.Incoming = "memory://jobs".ToUri());

            Channel(x => x.Incoming).ReadIncoming();

            NodeName = "Monitoring";
            NodeId   = nodeId;

            _nodeId = nodeId;

            ServiceBus.EnableInMemoryTransport(incoming);


            Services.ReplaceService(store);

            Services.AddService <ILogListener, ScheduledJobListener>();


            ScheduledJob.DefaultJobChannel(x => x.Incoming);
            ScheduledJob.RunJob <AlwaysGoodJob>().ScheduledBy <TenMinuteIncrements>();
            ScheduledJob.RunJob <FailsFirstTwoTimes>().ScheduledBy <SevenMinuteIncrements>();
            ScheduledJob.RunJob <FailsSometimes>().ScheduledBy <FiveMinuteIncrements>();
            ScheduledJob.RunJob <TimesOutSometimes>().ScheduledBy <ThreeMinuteIncrements>().Timeout(10.Seconds());
        }
        public AsyncRegistry()
        {
            ServiceBus.Enable(true);

            ServiceBus.EnableInMemoryTransport();

            Policies.Local.Add <WrapWithFoo>();
        }
        public PollingImmediateRegistry()
        {
            ServiceBus.Enable(true);

            ServiceBus.EnableInMemoryTransport();

            Polling.RunJob<ImmediateJob>().ScheduledAtInterval<PollingImmediateSettings>(x => x.ImmediateInterval).RunImmediately();
            Polling.RunJob<DelayJob>().ScheduledAtInterval<PollingImmediateSettings>(x => x.DelayInterval);
        }
Ejemplo n.º 5
0
        public GettingStartedTransportRegistry()
        {
            // You have to have at least one transport registered,
            // so we're enabling the in memory transport for this sample;)
            ServiceBus.EnableInMemoryTransport();

            Channel(x => x.Uri)
            //Routes messages in the in the getting started namespace to this channel
            .AcceptsMessages(x => typeof(GettingStartedSettings).Namespace.Equals(x.Namespace))
            .ReadIncoming();
        }
Ejemplo n.º 6
0
            public SubscriptionRegistry()
            {
                ServiceBus.EnableInMemoryTransport();

                Channel(x => x.Q1)
                .AcceptsMessage <Message1>()
                .AcceptsMessage <Message2>();

                Channel(x => x.Q2)
                .AcceptsMessage <Message2>()
                .AcceptsMessage <Message3>();
            }
        public DelayedRegistry()
        {
            Handlers.DisableDefaultHandlerSource();
            ServiceBus.EnableInMemoryTransport();

            // Need this to be fast for the tests
            AlterSettings <TransportSettings>(x => x.DelayMessagePolling = 100);

            Services.ReplaceService <ISystemTime>(new SettableClock());
            Handlers.Include <SimpleHandler <OneMessage> >();
            Channel(x => x.Downstream).ReadIncoming().AcceptsMessagesInAssemblyContainingType <OneMessage>();
        }
        public ModifyingChannelRegistry()
        {
            ServiceBus.Enable(true);
            ServiceBus.EnableInMemoryTransport();

            Services.ReplaceService(InMemoryTransport.ToInMemory <BusSettings>());

            Channel(x => x.Downstream).ModifyWith <FooModifier>();

            Channel(x => x.Upstream).ModifyWith(new BarModifier());

            Channel(x => x.Outbound).ReadIncoming();
        }
Ejemplo n.º 9
0
        public PollingRegistry()
        {
            ServiceBus.Enable(true);

            ServiceBus.EnableInMemoryTransport();

            Polling.RunJob <OneJob>().ScheduledAtInterval <PollingSettings>(x => x.OneInterval);
            Polling.RunJob <TwoJob>().ScheduledAtInterval <PollingSettings>(x => x.TwoInterval);
            Polling.RunJob <ThreeJob>().ScheduledAtInterval <PollingSettings>(x => x.ThreeInterval).RunImmediately();

            Polling.RunJob <DisabledJob>().ScheduledAtInterval <PollingSettings>(x => x.DisabledInterval).Disabled();

            Services.ReplaceService <IPollingJobLogger, RecordingPollingJobLogger>();
        }
        public RoutedRegistry()
        {
            ServiceBus.EnableInMemoryTransport();

            Channel(x => x.Service1).AcceptsMessage <Message1>();
            Channel(x => x.Service1).AcceptsMessage <Message2>();

            Channel(x => x.Service2).AcceptsMessage <Message3>();
            Channel(x => x.Service2).AcceptsMessage <Message4>();

            Channel(x => x.Service3).AcceptsMessage <Message2>();
            Channel(x => x.Service3).AcceptsMessage <Message3>();

            Channel(x => x.Service4).ReadIncoming();
        }
        public TestingJobRegistry()
        {
            ServiceBus.EnableInMemoryTransport();

            Channel(x => x.Upstream).ReadIncoming();

            ScheduledJob.ActivatedOnStartup(false);
            ScheduledJob.DefaultJobChannel(x => x.Upstream);
            ScheduledJob.RunJob <Job1>().ScheduledBy(new AtSecondsAfterTheMinute(3));
            ScheduledJob.RunJob <Job2>().ScheduledBy(new AtSecondsAfterTheMinute(10));
            ScheduledJob.RunJob <Job3>().ScheduledBy(new AtSecondsAfterTheMinute(15));

            Services.ReplaceService(new JobHistory());
            Services.ReplaceService <ISystemTime>(new RewindableClock());
        }
            public ControlQueueRegistry()
            {
                AlterSettings <BusSettings>(x =>
                {
                    x.Downstream = "memory://1".ToUri();
                    x.Upstream   = "memory://2".ToUri();
                });

                Channel(x => x.Downstream).ReadIncoming();
                Channel(x => x.Upstream).UseAsControlChannel();

                ServiceBus.EnableInMemoryTransport();


                Mode = "Testing";
            }
Ejemplo n.º 13
0
            public SubscribedRegistry()
            {
                ServiceBus.EnableInMemoryTransport();
                NodeName = "SubscribedService";

                Channel(x => x.Inbound).ReadIncoming();

                SubscribeLocally()
                .ToSource(x => x.Outbound)
                .ToMessage <Message1>()
                .ToMessage <Message3>();

                SubscribeAt(x => x.Inbound)
                .ToSource(x => x.Upstream)
                .ToMessage <Message2>()
                .ToMessage <Message4>();
            }
Ejemplo n.º 14
0
        public MonitoredNode(string nodeId, Uri incoming, PersistentTaskMessageListener listener)
        {
            AlterSettings <MonitoringSettings>(x => x.Incoming = incoming);
            NodeName = "Monitoring";
            NodeId   = nodeId;

            _nodeId = nodeId;

            ServiceBus.EnableInMemoryTransport(incoming);

            Services.AddService <ILogListener>(listener);

            AlterSettings <HealthMonitoringSettings>(_ =>
            {
                _.TakeOwnershipMessageTimeout  = 3.Seconds();
                _.HealthCheckMessageTimeout    = 1.Seconds();
                _.DeactivationMessageTimeout   = 3.Seconds();
                _.TaskAvailabilityCheckTimeout = 5.Seconds();
            });
        }
Ejemplo n.º 15
0
 public MyFirstTransport()
 {
     ServiceBus.EnableInMemoryTransport();
     ServiceBus.Enable(true);
 }
Ejemplo n.º 16
0
 public Defaults()
 {
     ServiceBus.Enable(true);
     ServiceBus.EnableInMemoryTransport();
 }
 public CustomTransportRegistry()
 {
     ServiceBus.Enable(true);
     ServiceBus.EnableInMemoryTransport();
 }
 public RetryNoOnDbConcurrencyRegistry()
 {
     ServiceBus.Enable(true);
     ServiceBus.EnableInMemoryTransport();
     Policies.Local.Add <RetryNowOnDbConcurrencyException>();
 }
 public OtherRegistry()
 {
     ServiceBus.Enable(true);
     ServiceBus.EnableInMemoryTransport();
 }
 public CountAndRetryOnExceptionRegistry()
 {
     ServiceBus.Enable(true);
     ServiceBus.EnableInMemoryTransport();
     Policies.Local.Add <CountAndRetryOnExceptionPolicy>();
 }