public StoreTimeoutBehavior(ExpiredTimeoutsPoller poller, IDispatchMessages dispatcher, IPersistTimeouts persister, string owningTimeoutManager) { this.poller = poller; this.dispatcher = dispatcher; this.persister = persister; this.owningTimeoutManager = owningTimeoutManager; }
static Task Add(IPersistTimeouts inMemoryTimeoutPersister, ContextBag context) { return(inMemoryTimeoutPersister.Add(new TimeoutData { Time = DateTime.Now, Id = Thread.CurrentThread.Name }, context)); }
public void Setup() { Address.InitializeLocalAddress("MyEndpoint"); Configure.GetEndpointNameAction = () => "MyEndpoint"; persister = CreateTimeoutPersister(); }
public void SetupContext() { store = new EmbeddableDocumentStore { RunInMemory = true }; //store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "MyServer" }; store.Initialize(); persister = new RavenTimeoutPersistence(store); }
public void SetupContext() { store = new EmbeddableDocumentStore { RunInMemory = true }; //store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "MyServer" }; store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; //This turns on WaitForNonStaleResults() on queries globally store.Conventions.MaxNumberOfRequestsPerSession = 10; store.Initialize(); persister = new RavenTimeoutPersistence(store); }
IPersistTimeouts TryResolveTimeoutPersister() { IPersistTimeouts timeoutPersister = null; try { timeoutPersister = builder.Build <IPersistTimeouts>(); } catch (Exception) { // catch potential DI exception when interface not registered. } return(timeoutPersister); }
public void Setup() { persister = CreateTimeoutPersister(); messageSender = new FakeMessageSender(); manager = new DefaultTimeoutManager { TimeoutsPersister = persister, MessageSender = messageSender, }; receiver = new TimeoutPersisterReceiver { TimeoutManager = manager, TimeoutsPersister = persister, MessageSender = messageSender, SecondsToSleepBetweenPolls = 1, }; }
public void SetupContext() { #if USESQL var sqlBuilder = new SqlConnectionStringBuilder(); sqlBuilder.DataSource = @".\SQLEXPRESS"; sqlBuilder.InitialCatalog = "nservicebus"; sqlBuilder.IntegratedSecurity = true; var cfg = new Configuration() .DataBaseIntegration(x => { x.Driver<Sql2008ClientDriver>(); x.Dialect<MsSql2008Dialect>(); x.ConnectionString = sqlBuilder.ConnectionString; }); #else var cfg = new Configuration() .DataBaseIntegration(x => { x.Dialect<SQLiteDialect>(); x.ConnectionString = string.Format(@"Data Source={0};Version=3;New=True;", Path.GetTempFileName()); }); #endif var mapper = new ModelMapper(); mapper.AddMappings(typeof (TimeoutEntity).Assembly.GetExportedTypes()); var mapping = mapper.CompileMappingForAllExplicitlyAddedEntities(); cfg.AddMapping(mapping); sessionFactory = cfg.BuildSessionFactory(); persister = new TimeoutStorage { SessionFactory = sessionFactory }; Configure.Instance.DefineEndpointName("MyEndpoint"); new SchemaUpdate(cfg).Execute(false, true); }
public void SetupContext() { #if USESQL var sqlBuilder = new SqlConnectionStringBuilder(); sqlBuilder.DataSource = @".\SQLEXPRESS"; sqlBuilder.InitialCatalog = "nservicebus"; sqlBuilder.IntegratedSecurity = true; var cfg = new Configuration() .DataBaseIntegration(x => { x.Driver <Sql2008ClientDriver>(); x.Dialect <MsSql2008Dialect>(); x.ConnectionString = sqlBuilder.ConnectionString; }); #else var cfg = new Configuration() .DataBaseIntegration(x => { x.Dialect <SQLiteDialect>(); x.ConnectionString = string.Format(@"Data Source={0};Version=3;New=True;", Path.GetTempFileName()); }); #endif var mapper = new ModelMapper(); mapper.AddMappings(typeof(TimeoutEntity).Assembly.GetExportedTypes()); var mapping = mapper.CompileMappingForAllExplicitlyAddedEntities(); cfg.AddMapping(mapping); sessionFactory = cfg.BuildSessionFactory(); persister = new TimeoutStorage { SessionFactory = sessionFactory }; Configure.Instance.DefineEndpointName("MyEndpoint"); new SchemaUpdate(cfg).Execute(false, true); }
public void Setup() { Address.InitializeLocalAddress("MyEndpoint"); Configure.GetEndpointNameAction = () => "MyEndpoint"; persister = CreateTimeoutPersister(); messageSender = new FakeMessageSender(); manager = new DefaultTimeoutManager { TimeoutsPersister = persister, MessageSender = messageSender, }; receiver = new TimeoutPersisterReceiver(manager) { TimeoutsPersister = persister, MessageSender = messageSender, SecondsToSleepBetweenPolls = 1, }; }
public DispatchTimeoutBehavior(IDispatchMessages dispatcher, IPersistTimeouts persister, TransportTransactionMode transportTransactionMode) { this.dispatcher = dispatcher; this.persister = persister; dispatchConsistency = GetDispatchConsistency(transportTransactionMode); }
public void Setup() { persister = CreateTimeoutPersister(); }
public void SetupContext() { Configure.GetEndpointNameAction = () => "MyEndpoint"; persister = new InMemoryTimeoutPersistence(); }
public TimeoutPersistanceWrapper(IPersistTimeouts originalTimeoutPersister, IPersistTimeoutsV2 originalTimeoutPersisterV2, Context context) { this.originalTimeoutPersister = originalTimeoutPersister; this.originalTimeoutPersisterV2 = originalTimeoutPersisterV2; this.context = context; }
public TimeoutProcessor(IPersistTimeouts timeoutStore, ISendMessages messageSender) { this.timeoutStore = timeoutStore; this.messageSender = messageSender; }
Task RemoveTimeoutBy(IPersistTimeouts inMemoryTimeoutPersister, ContextBag context) { var sagaId = sagaIdGuids.GetOrAdd(Thread.CurrentThread.ManagedThreadId, new Guid()); return(inMemoryTimeoutPersister.RemoveTimeoutBy(sagaId, context)); }
static async Task TryRemove(IPersistTimeouts inMemoryTimeoutPersister, ContextBag context) { await inMemoryTimeoutPersister.TryRemove(Thread.CurrentThread.Name, context); }