public override void SetUp()
        {
            _envelopes.Clear();
            _nodeLockers.Clear();

            _workers = new RecordingWorkerQueue();

            _host = JasperHost.CreateDefaultBuilder()
                    .UseJasper(_ =>
            {
                _.ServiceName = Guid.NewGuid().ToString();

                _.MartenConnectionStringIs(Servers.PostgresConnectionString);

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

                _.Include <MartenBackedPersistence>();

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


            _admin = _host.Get <IEnvelopePersistence>().Admin;
            _admin.RebuildSchemaObjects();

            _settings    = _host.Get <PostgresqlSettings>();
            _serializers = _host.Get <MessagingSerializationGraph>();

            theStore = _host.Get <IDocumentStore>();
            theStore.Advanced.Clean.DeleteAllDocuments();

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

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

            _workers = new RecordingWorkerQueue();

            _host = Host.CreateDefaultBuilder()
                    .UseJasper(_ =>
            {
                _.ServiceName = Guid.NewGuid().ToString();

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

                _.Extensions.UseMarten(Servers.PostgresConnectionString);

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


                _.Advanced.FirstNodeReassignmentExecution = 30.Minutes();
                _.Advanced.ScheduledJobFirstExecution     = 30.Minutes();
                _.Advanced.FirstNodeReassignmentExecution = 30.Minutes();
                _.Advanced.NodeReassignmentPollingTime    = 30.Minutes();
            })
                    .Start();


            _admin = _host.Services.GetService <IEnvelopePersistence>().Admin;
            _admin.RebuildSchemaObjects();

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

            theStore = _host.Services.GetService <IDocumentStore>();
            theStore.Advanced.Clean.DeleteAllDocuments();

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

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

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

            _runtime = JasperRuntime.For(_ =>
            {
                _.MartenConnectionStringIs(Servers.PostgresConnectionString);
                _.Services.AddSingleton <ITransport, StubTransport>();

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

                _.Include <MartenBackedPersistence>();

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

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

            _marker      = _runtime.Get <EnvelopeTables>();
            _serializers = _runtime.Get <MessagingSerializationGraph>();

            theStore = _runtime.Get <IDocumentStore>();
            theStore.Advanced.Clean.DeleteAllDocuments();

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

            _owners["This Node"] = _currentNodeId;
        }