2016-11-20 14:34:50 +01:00
|
|
|
|
using System;
|
|
|
|
|
using SimpleInjector;
|
|
|
|
|
using Tapeti;
|
2017-01-31 12:01:08 +01:00
|
|
|
|
using Tapeti.Flow;
|
2017-02-08 15:52:24 +01:00
|
|
|
|
using Tapeti.Flow.SQL;
|
2016-11-20 14:34:50 +01:00
|
|
|
|
using Tapeti.SimpleInjector;
|
|
|
|
|
|
|
|
|
|
namespace Test
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
|
|
|
|
private static void Main()
|
|
|
|
|
{
|
2017-02-07 16:13:33 +01:00
|
|
|
|
// TODO SQL based flow store
|
|
|
|
|
// TODO logging
|
2017-02-08 15:52:24 +01:00
|
|
|
|
// TODO uitzoeken of we consumers kunnen pauzeren (denk: SQL down) --> nee, EFDBContext Get Async maken en retryen? kan dat, of timeout dan Rabbit?
|
2017-02-07 16:13:33 +01:00
|
|
|
|
|
2016-11-20 14:34:50 +01:00
|
|
|
|
var container = new Container();
|
2016-12-07 10:19:16 +01:00
|
|
|
|
container.Register<MarcoEmitter>();
|
2016-12-13 22:01:43 +01:00
|
|
|
|
container.Register<Visualizer>();
|
2016-12-07 10:19:16 +01:00
|
|
|
|
|
2017-02-08 15:52:24 +01:00
|
|
|
|
//container.Register<IFlowRepository>(() => new EF(serviceID));
|
2017-02-07 18:22:28 +01:00
|
|
|
|
|
2017-02-07 16:13:33 +01:00
|
|
|
|
var config = new TapetiConfig(new SimpleInjectorDependencyResolver(container))
|
2017-02-05 23:22:34 +01:00
|
|
|
|
.WithFlow()
|
2017-02-08 15:52:24 +01:00
|
|
|
|
//.WithFlowSqlRepository("data source=localhost;initial catalog=lef;integrated security=True;multipleactiveresultsets=True", 1)
|
2016-12-07 10:19:16 +01:00
|
|
|
|
.RegisterAllControllers()
|
|
|
|
|
.Build();
|
2016-11-20 14:34:50 +01:00
|
|
|
|
|
2017-02-05 23:22:34 +01:00
|
|
|
|
using (var connection = new TapetiConnection(config)
|
|
|
|
|
{
|
2017-02-08 15:52:24 +01:00
|
|
|
|
Params = new TapetiAppSettingsConnectionParams()
|
2017-02-05 23:22:34 +01:00
|
|
|
|
})
|
|
|
|
|
{
|
2016-11-20 14:34:50 +01:00
|
|
|
|
Console.WriteLine("Subscribing...");
|
|
|
|
|
connection.Subscribe().Wait();
|
|
|
|
|
Console.WriteLine("Done!");
|
|
|
|
|
|
2016-12-05 08:00:09 +01:00
|
|
|
|
var emitter = container.GetInstance<MarcoEmitter>();
|
|
|
|
|
emitter.Run().Wait();
|
2016-11-20 14:34:50 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|