Ejemplo n.º 1
0
        public override void SetUp()
        {
            _envelopes.Clear();
            _nodeLockers.Clear();

            _workers        = new RecordingWorkerQueue();
            _schedulerAgent = new RecordingSchedulingAgent();

            _host = JasperHost.For(_ =>
            {
                _.Settings.PersistMessagesWithSqlServer(Servers.SqlServerConnectionString);

                _.Services.AddSingleton <IWorkerQueue>(_workers);
                _.Services.AddSingleton <IDurabilityAgent>(_schedulerAgent);


                _.Settings.Alter <JasperOptions>(x =>
                {
                    x.Retries.FirstNodeReassignmentExecution = 30.Minutes();
                    x.ScheduledJobs.FirstExecution           = 30.Minutes();
                    x.Retries.FirstNodeReassignmentExecution = 30.Minutes();
                    x.Retries.NodeReassignmentPollingTime    = 30.Minutes();
                });
            });

            _host.Get <IEnvelopePersistence>().Admin.ClearAllPersistedEnvelopes();

            _serializers = _host.Get <MessagingSerializationGraph>();

            _host.RebuildMessageStorage();

            _currentNodeId = _host.Get <JasperOptions>().UniqueNodeId;

            _owners["This Node"] = _currentNodeId;
        }
Ejemplo n.º 2
0
        public override void SetUp()
        {
            _envelopes.Clear();
            _nodeLockers.Clear();

            _workers        = new RecordingWorkerQueue();
            _schedulerAgent = new RecordingSchedulingAgent();

            _runtime = JasperRuntime.For(_ =>
            {
                _.Settings.PersistMessagesWithSqlServer(Servers.SqlServerConnectionString);
                _.Services.AddSingleton <ITransport, StubTransport>();

                _.Services.AddSingleton <IWorkerQueue>(_workers);
                _.Services.AddSingleton <ISchedulingAgent>(_schedulerAgent);


                _.Settings.Alter <JasperOptions>(x =>
                {
                    x.Retries.FirstNodeReassignmentExecution = 30.Minutes();
                    x.ScheduledJobs.FirstExecution           = 30.Minutes();
                    x.Retries.FirstNodeReassignmentExecution = 30.Minutes();
                    x.Retries.NodeReassignmentPollingTime    = 30.Minutes();
                });
            });

            _runtime.Get <SqlServerBackedDurableMessagingFactory>().ClearAllStoredMessages();

            _serializers = _runtime.Get <MessagingSerializationGraph>();

            _runtime.RebuildMessageStorage();

            _currentNodeId = _runtime.Get <JasperOptions>().UniqueNodeId;

            _owners["This Node"] = _currentNodeId;
        }
Ejemplo n.º 3
0
        public override void SetUp()
        {
            _envelopes.Clear();
            _nodeLockers.Clear();

            _workers        = new RecordingWorkerQueue();
            _schedulerAgent = new RecordingSchedulingAgent();


            _host = Host.CreateDefaultBuilder()
                    .UseJasper(_ =>
            {
                _.Extensions.PersistMessagesWithSqlServer(Servers.SqlServerConnectionString);

                _.Endpoints.As <TransportCollection>().Add(new StubTransport());

                _.Services.AddSingleton <IWorkerQueue>(_workers);
                _.Services.AddSingleton <IDurabilityAgent>(_schedulerAgent);
                _.Advanced.FirstNodeReassignmentExecution = 30.Minutes();
                _.Advanced.ScheduledJobFirstExecution     = 30.Minutes();
                _.Advanced.FirstNodeReassignmentExecution = 30.Minutes();
                _.Advanced.NodeReassignmentPollingTime    = 30.Minutes();
            })
                    .Start();


            _host.Services.GetService <IEnvelopePersistence>().Admin.ClearAllPersistedEnvelopes();

            _serializers = _host.Services.GetService <MessagingSerializationGraph>();

            _host.RebuildMessageStorage();

            _currentNodeId = _host.Services.GetService <AdvancedSettings>().UniqueNodeId;

            _owners["This Node"] = _currentNodeId;
        }