Skip to content

Commit 3e0c841

Browse files
committed
Merge branch 'develop'
2 parents 7b34cd8 + 4622a11 commit 3e0c841

File tree

66 files changed

+2918
-607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2918
-607
lines changed

CONTRIBUTORS.md

+2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ If you think your name is missing from the list, create a pull-request.
1919

2020
* Created following packages
2121
* `EventFlow.DependencyInjection`
22+
* `EventFlow.EntityFramework`
2223
* Several key contributions and bug fixes
2324

2425
### [idubnori](https://github.com/idubnori)
2526

2627
* PostgreSQL implementation
28+
* EntityFramework implementation
2729

2830
### [Jaco Coetzee](https://github.com/JC008)
2931

EventFlow.sln

+21-3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.DependencyInjecti
8989
EndProject
9090
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyInjection", "DependencyInjection", "{E2DD51BC-974B-4526-961B-825913911FFB}"
9191
EndProject
92+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFramework", "EntityFramework", "{57948D64-F072-4FB7-858E-A63366C55645}"
93+
EndProject
94+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.EntityFramework.Tests", "Source\EventFlow.EntityFramework.Tests\EventFlow.EntityFramework.Tests.csproj", "{DB2BF39F-9225-4697-89AF-A6A95629A109}"
95+
EndProject
96+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.EntityFramework", "Source\EventFlow.EntityFramework\EventFlow.EntityFramework.csproj", "{5B9A10E8-E6AF-4A70-9594-187123293396}"
97+
EndProject
98+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PostgreSQL", "PostgreSQL", "{5B2706DA-B66C-4CD9-8441-8C9BDACB8348}"
99+
EndProject
92100
Global
93101
GlobalSection(SolutionConfigurationPlatforms) = preSolution
94102
Debug|Any CPU = Debug|Any CPU
@@ -215,6 +223,14 @@ Global
215223
{28CA7AD8-6A73-454C-ABF4-26B24D986C85}.Debug|Any CPU.Build.0 = Debug|Any CPU
216224
{28CA7AD8-6A73-454C-ABF4-26B24D986C85}.Release|Any CPU.ActiveCfg = Release|Any CPU
217225
{28CA7AD8-6A73-454C-ABF4-26B24D986C85}.Release|Any CPU.Build.0 = Release|Any CPU
226+
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
227+
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Debug|Any CPU.Build.0 = Debug|Any CPU
228+
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Release|Any CPU.ActiveCfg = Release|Any CPU
229+
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Release|Any CPU.Build.0 = Release|Any CPU
230+
{5B9A10E8-E6AF-4A70-9594-187123293396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
231+
{5B9A10E8-E6AF-4A70-9594-187123293396}.Debug|Any CPU.Build.0 = Debug|Any CPU
232+
{5B9A10E8-E6AF-4A70-9594-187123293396}.Release|Any CPU.ActiveCfg = Release|Any CPU
233+
{5B9A10E8-E6AF-4A70-9594-187123293396}.Release|Any CPU.Build.0 = Release|Any CPU
218234
EndGlobalSection
219235
GlobalSection(SolutionProperties) = preSolution
220236
HideSolutionNode = FALSE
@@ -245,11 +261,13 @@ Global
245261
{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5} = {980EEDAA-1FEF-4D7C-8811-5EF1D9729773}
246262
{9D57E096-AA8E-40E5-A1CC-32C07B425850} = {3A34F6A2-64B0-4730-A0EB-D324BC755538}
247263
{C16B0B27-6E6C-439C-8419-488B2D4D798F} = {3A34F6A2-64B0-4730-A0EB-D324BC755538}
248-
{8611714D-5901-4D85-ACA3-8B984F591BDD} = {92F3C263-8C0C-4D12-B41A-452E48D2E5E8}
249-
{1400DAC5-118E-41D3-A20C-F4F8648BC5BF} = {8611714D-5901-4D85-ACA3-8B984F591BDD}
250-
{6C47746E-8F5D-4DA9-BBD1-17ECEE57F8CB} = {8611714D-5901-4D85-ACA3-8B984F591BDD}
264+
{1400DAC5-118E-41D3-A20C-F4F8648BC5BF} = {5B2706DA-B66C-4CD9-8441-8C9BDACB8348}
265+
{6C47746E-8F5D-4DA9-BBD1-17ECEE57F8CB} = {5B2706DA-B66C-4CD9-8441-8C9BDACB8348}
251266
{7870461F-BA5B-4198-A85E-03BA555198AD} = {E2DD51BC-974B-4526-961B-825913911FFB}
252267
{28CA7AD8-6A73-454C-ABF4-26B24D986C85} = {E2DD51BC-974B-4526-961B-825913911FFB}
268+
{DB2BF39F-9225-4697-89AF-A6A95629A109} = {57948D64-F072-4FB7-858E-A63366C55645}
269+
{5B9A10E8-E6AF-4A70-9594-187123293396} = {57948D64-F072-4FB7-858E-A63366C55645}
270+
{5B2706DA-B66C-4CD9-8441-8C9BDACB8348} = {92F3C263-8C0C-4D12-B41A-452E48D2E5E8}
253271
EndGlobalSection
254272
GlobalSection(ExtensibilityGlobals) = postSolution
255273
SolutionGuid = {17607E2C-4E8E-45A2-85BD-0A5808E1C0F3}

README.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ to the documentation.
7676
* In-memory - only for test
7777
* Files - only for test
7878
* Microsoft SQL Server
79+
* Entity Framework Core
80+
* SQLite
81+
* PostgreSQL
7982
* EventStore - [home page](https://eventstore.org/)
8083
* [**Subscribers:**](http://docs.geteventflow.net/Subscribers.html)
8184
Listeners that act on specific domain events. Useful if an specific action
@@ -86,13 +89,19 @@ to the documentation.
8689
* [Elasticsearch](http://docs.geteventflow.net/ReadStores.html#elasticsearch)
8790
* [In-memory](http://docs.geteventflow.net/ReadStores.html#in-memory) - only for test
8891
* [Microsoft SQL Server](http://docs.geteventflow.net/ReadStores.html#microsoft-sql-server)
92+
* Entity Framework Core
93+
* SQLite
94+
* PostgreSQL
8995
* [**Snapshots:**](http://docs.geteventflow.net/Snapshots.html)
9096
Instead of reading the entire event stream every single time, a snapshot can
9197
be created every so often that contains the aggregate state. EventFlow
9298
supports upgrading existing snapshots, which is useful for long-lived
9399
aggregates. Snapshots in EventFlow are opt-in and EventFlow has support for
94100
* [In-memory](http://docs.geteventflow.net/Snapshots.html#in-memory) - only for test
95101
* [Microsoft SQL Server](http://docs.geteventflow.net/Snapshots.html#microsoft-sql-server)
102+
* Entity Framework Core
103+
* SQLite
104+
* PostgreSQL
96105
* [**Sagas:**](http://docs.geteventflow.net/Sagas.html)
97106
Also known as _process managers_, coordinates and routes messages between
98107
bounded contexts and aggregates
@@ -325,16 +334,14 @@ share it by creating an issue with the link.
325334
EventFlow has several tests that verify that its able to use the systems it
326335
integrates with correctly.
327336

328-
* **Elasticsearch:** [Elasticsearch](https://www.elastic.co/) is automatically
329-
downloaded and run during the Elasticsearch integration tests from your `TEMP`
330-
directory. Requires Java to be installed and the `JAVA_HOME` environment
331-
variable set
332-
* **EventStore:** [EventStore](https://geteventstore.com/) is automatically
333-
downloaded and run during the EventStore integration tests from your `TEMP`
334-
directory
337+
* **Elasticsearch:** [Elasticsearch](https://www.elastic.co/) run as Docker [Windows Container](https://docs.microsoft.com//virtualization/windowscontainers/about/). if use in local, requires its environment and `docker-compose` tool, and execute `PS> up_integration-test-env.ps1`
338+
* **EventStore:** [EventStore](https://geteventstore.com/) is same as the above
339+
* **RabbitMQ:** [RabbitMQ](https://www.rabbitmq.com/) is same as the above
335340
* **MSSQL:** Microsoft SQL Server is required to be running
336341
* **RabbitMQ:** Set an environment variable named `RABBITMQ_URL` with the URL
337342
for the [RabbitMQ](https://www.rabbitmq.com/) instance you would like to use.
343+
* **EntityFramework:** Microsoft SQL Server and PostgreSQL is required to be running
344+
* **PostgreSQL:** PostgreSQL is required to be running
338345

339346
There's a Vagrant box with both Elasticsearch and RabbitMQ you can use
340347
[here](https://github.com/rasmus/Vagrant.Boxes).

RELEASE_NOTES.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
### New in 0.64 (not released yet)
1+
### New in 0.65 (not released yet)
2+
3+
* Minor: Performance improvement of storing events for `EventFlow.PostgreSql`
4+
5+
### New in 0.64.3598 (released 2018-08-24)
26

37
* New: Added .NET standard support for SQLite
48

Source/EventFlow.Elasticsearch.Tests/ElasticsearchRunner.cs

-167
This file was deleted.

Source/EventFlow.Elasticsearch.Tests/IntegrationTests/ElasticsearchReadModelStoreTests.cs

+33-53
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,9 @@ public class ElasticsearchReadModelStoreTests : TestSuiteForReadModelStore
4747
protected override Type ReadModelType { get; } = typeof(ElasticsearchThingyReadModel);
4848

4949
private IElasticClient _elasticClient;
50-
private ElasticsearchRunner.ElasticsearchInstance _elasticsearchInstance;
51-
private string _indexName;
5250

53-
[OneTimeSetUp]
54-
public void FixtureSetUp()
55-
{
56-
_elasticsearchInstance = ElasticsearchRunner.StartAsync().Result;
57-
}
58-
59-
[OneTimeTearDown]
60-
public void FixtureTearDown()
61-
{
62-
_elasticsearchInstance.DisposeSafe("Failed to close Elasticsearch down");
63-
}
51+
private string _elasticsearchUrl;
52+
private string _indexName;
6453

6554
public class TestReadModelDescriptionProvider : IReadModelDescriptionProvider
6655
{
@@ -81,46 +70,37 @@ public ReadModelDescription GetReadModelDescription<TReadModel>() where TReadMod
8170

8271
protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
8372
{
84-
try
85-
{
86-
_indexName = $"eventflow-test-{Guid.NewGuid():D}";
87-
88-
var testReadModelDescriptionProvider = new TestReadModelDescriptionProvider(_indexName);
89-
90-
var resolver = eventFlowOptions
91-
.RegisterServices(sr =>
92-
{
93-
sr.RegisterType(typeof(ThingyMessageLocator));
94-
sr.Register<IReadModelDescriptionProvider>(c => testReadModelDescriptionProvider);
95-
})
96-
.ConfigureElasticsearch(_elasticsearchInstance.Uri)
97-
.UseElasticsearchReadModelFor<ThingyAggregate, ThingyId, ElasticsearchThingyReadModel>()
98-
.UseElasticsearchReadModel<ElasticsearchThingyMessageReadModel, ThingyMessageLocator>()
99-
.AddQueryHandlers(
100-
typeof(ElasticsearchThingyGetQueryHandler),
101-
typeof(ElasticsearchThingyGetVersionQueryHandler),
102-
typeof(ElasticsearchThingyGetMessagesQueryHandler))
103-
.CreateResolver();
104-
105-
_elasticClient = resolver.Resolve<IElasticClient>();
106-
107-
_elasticClient.CreateIndex(_indexName, c => c
108-
.Settings(s => s
109-
.NumberOfShards(1)
110-
.NumberOfReplicas(0))
111-
.Mappings(m => m
112-
.Map<ElasticsearchThingyMessageReadModel>(d => d
113-
.AutoMap())));
114-
115-
_elasticsearchInstance.WaitForGreenStateAsync().Wait(TimeSpan.FromMinutes(1));
116-
117-
return resolver;
118-
}
119-
catch
120-
{
121-
_elasticsearchInstance.DisposeSafe("Failed to dispose ES instance");
122-
throw;
123-
}
73+
_elasticsearchUrl = Environment.GetEnvironmentVariable("ELASTICSEARCH_URL");
74+
_indexName = $"eventflow-test-{Guid.NewGuid():D}";
75+
76+
var testReadModelDescriptionProvider = new TestReadModelDescriptionProvider(_indexName);
77+
78+
var resolver = eventFlowOptions
79+
.RegisterServices(sr =>
80+
{
81+
sr.RegisterType(typeof(ThingyMessageLocator));
82+
sr.Register<IReadModelDescriptionProvider>(c => testReadModelDescriptionProvider);
83+
})
84+
.ConfigureElasticsearch(_elasticsearchUrl)
85+
.UseElasticsearchReadModelFor<ThingyAggregate, ThingyId, ElasticsearchThingyReadModel>()
86+
.UseElasticsearchReadModel<ElasticsearchThingyMessageReadModel, ThingyMessageLocator>()
87+
.AddQueryHandlers(
88+
typeof(ElasticsearchThingyGetQueryHandler),
89+
typeof(ElasticsearchThingyGetVersionQueryHandler),
90+
typeof(ElasticsearchThingyGetMessagesQueryHandler))
91+
.CreateResolver();
92+
93+
_elasticClient = resolver.Resolve<IElasticClient>();
94+
95+
_elasticClient.CreateIndex(_indexName, c => c
96+
.Settings(s => s
97+
.NumberOfShards(1)
98+
.NumberOfReplicas(0))
99+
.Mappings(m => m
100+
.Map<ElasticsearchThingyMessageReadModel>(d => d
101+
.AutoMap())));
102+
103+
return resolver;
124104
}
125105

126106
[TearDown]

0 commit comments

Comments
 (0)