Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus committed Sep 22, 2018
2 parents 7b34cd8 + 4622a11 commit 3e0c841
Show file tree
Hide file tree
Showing 66 changed files with 2,918 additions and 607 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ If you think your name is missing from the list, create a pull-request.

* Created following packages
* `EventFlow.DependencyInjection`
* `EventFlow.EntityFramework`
* Several key contributions and bug fixes

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

* PostgreSQL implementation
* EntityFramework implementation

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

Expand Down
24 changes: 21 additions & 3 deletions EventFlow.sln
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.DependencyInjecti
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyInjection", "DependencyInjection", "{E2DD51BC-974B-4526-961B-825913911FFB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFramework", "EntityFramework", "{57948D64-F072-4FB7-858E-A63366C55645}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.EntityFramework.Tests", "Source\EventFlow.EntityFramework.Tests\EventFlow.EntityFramework.Tests.csproj", "{DB2BF39F-9225-4697-89AF-A6A95629A109}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventFlow.EntityFramework", "Source\EventFlow.EntityFramework\EventFlow.EntityFramework.csproj", "{5B9A10E8-E6AF-4A70-9594-187123293396}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PostgreSQL", "PostgreSQL", "{5B2706DA-B66C-4CD9-8441-8C9BDACB8348}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -215,6 +223,14 @@ Global
{28CA7AD8-6A73-454C-ABF4-26B24D986C85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28CA7AD8-6A73-454C-ABF4-26B24D986C85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28CA7AD8-6A73-454C-ABF4-26B24D986C85}.Release|Any CPU.Build.0 = Release|Any CPU
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB2BF39F-9225-4697-89AF-A6A95629A109}.Release|Any CPU.Build.0 = Release|Any CPU
{5B9A10E8-E6AF-4A70-9594-187123293396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B9A10E8-E6AF-4A70-9594-187123293396}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B9A10E8-E6AF-4A70-9594-187123293396}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B9A10E8-E6AF-4A70-9594-187123293396}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -245,11 +261,13 @@ Global
{EFDD4B74-E69A-4F4F-80F4-DC8F32CD76A5} = {980EEDAA-1FEF-4D7C-8811-5EF1D9729773}
{9D57E096-AA8E-40E5-A1CC-32C07B425850} = {3A34F6A2-64B0-4730-A0EB-D324BC755538}
{C16B0B27-6E6C-439C-8419-488B2D4D798F} = {3A34F6A2-64B0-4730-A0EB-D324BC755538}
{8611714D-5901-4D85-ACA3-8B984F591BDD} = {92F3C263-8C0C-4D12-B41A-452E48D2E5E8}
{1400DAC5-118E-41D3-A20C-F4F8648BC5BF} = {8611714D-5901-4D85-ACA3-8B984F591BDD}
{6C47746E-8F5D-4DA9-BBD1-17ECEE57F8CB} = {8611714D-5901-4D85-ACA3-8B984F591BDD}
{1400DAC5-118E-41D3-A20C-F4F8648BC5BF} = {5B2706DA-B66C-4CD9-8441-8C9BDACB8348}
{6C47746E-8F5D-4DA9-BBD1-17ECEE57F8CB} = {5B2706DA-B66C-4CD9-8441-8C9BDACB8348}
{7870461F-BA5B-4198-A85E-03BA555198AD} = {E2DD51BC-974B-4526-961B-825913911FFB}
{28CA7AD8-6A73-454C-ABF4-26B24D986C85} = {E2DD51BC-974B-4526-961B-825913911FFB}
{DB2BF39F-9225-4697-89AF-A6A95629A109} = {57948D64-F072-4FB7-858E-A63366C55645}
{5B9A10E8-E6AF-4A70-9594-187123293396} = {57948D64-F072-4FB7-858E-A63366C55645}
{5B2706DA-B66C-4CD9-8441-8C9BDACB8348} = {92F3C263-8C0C-4D12-B41A-452E48D2E5E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {17607E2C-4E8E-45A2-85BD-0A5808E1C0F3}
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ to the documentation.
* In-memory - only for test
* Files - only for test
* Microsoft SQL Server
* Entity Framework Core
* SQLite
* PostgreSQL
* EventStore - [home page](https://eventstore.org/)
* [**Subscribers:**](http://docs.geteventflow.net/Subscribers.html)
Listeners that act on specific domain events. Useful if an specific action
Expand All @@ -86,13 +89,19 @@ to the documentation.
* [Elasticsearch](http://docs.geteventflow.net/ReadStores.html#elasticsearch)
* [In-memory](http://docs.geteventflow.net/ReadStores.html#in-memory) - only for test
* [Microsoft SQL Server](http://docs.geteventflow.net/ReadStores.html#microsoft-sql-server)
* Entity Framework Core
* SQLite
* PostgreSQL
* [**Snapshots:**](http://docs.geteventflow.net/Snapshots.html)
Instead of reading the entire event stream every single time, a snapshot can
be created every so often that contains the aggregate state. EventFlow
supports upgrading existing snapshots, which is useful for long-lived
aggregates. Snapshots in EventFlow are opt-in and EventFlow has support for
* [In-memory](http://docs.geteventflow.net/Snapshots.html#in-memory) - only for test
* [Microsoft SQL Server](http://docs.geteventflow.net/Snapshots.html#microsoft-sql-server)
* Entity Framework Core
* SQLite
* PostgreSQL
* [**Sagas:**](http://docs.geteventflow.net/Sagas.html)
Also known as _process managers_, coordinates and routes messages between
bounded contexts and aggregates
Expand Down Expand Up @@ -325,16 +334,14 @@ share it by creating an issue with the link.
EventFlow has several tests that verify that its able to use the systems it
integrates with correctly.

* **Elasticsearch:** [Elasticsearch](https://www.elastic.co/) is automatically
downloaded and run during the Elasticsearch integration tests from your `TEMP`
directory. Requires Java to be installed and the `JAVA_HOME` environment
variable set
* **EventStore:** [EventStore](https://geteventstore.com/) is automatically
downloaded and run during the EventStore integration tests from your `TEMP`
directory
* **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`
* **EventStore:** [EventStore](https://geteventstore.com/) is same as the above
* **RabbitMQ:** [RabbitMQ](https://www.rabbitmq.com/) is same as the above
* **MSSQL:** Microsoft SQL Server is required to be running
* **RabbitMQ:** Set an environment variable named `RABBITMQ_URL` with the URL
for the [RabbitMQ](https://www.rabbitmq.com/) instance you would like to use.
* **EntityFramework:** Microsoft SQL Server and PostgreSQL is required to be running
* **PostgreSQL:** PostgreSQL is required to be running

There's a Vagrant box with both Elasticsearch and RabbitMQ you can use
[here](https://github.com/rasmus/Vagrant.Boxes).
Expand Down
6 changes: 5 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
### New in 0.64 (not released yet)
### New in 0.65 (not released yet)

* Minor: Performance improvement of storing events for `EventFlow.PostgreSql`

### New in 0.64.3598 (released 2018-08-24)

* New: Added .NET standard support for SQLite

Expand Down
167 changes: 0 additions & 167 deletions Source/EventFlow.Elasticsearch.Tests/ElasticsearchRunner.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,9 @@ public class ElasticsearchReadModelStoreTests : TestSuiteForReadModelStore
protected override Type ReadModelType { get; } = typeof(ElasticsearchThingyReadModel);

private IElasticClient _elasticClient;
private ElasticsearchRunner.ElasticsearchInstance _elasticsearchInstance;
private string _indexName;

[OneTimeSetUp]
public void FixtureSetUp()
{
_elasticsearchInstance = ElasticsearchRunner.StartAsync().Result;
}

[OneTimeTearDown]
public void FixtureTearDown()
{
_elasticsearchInstance.DisposeSafe("Failed to close Elasticsearch down");
}
private string _elasticsearchUrl;
private string _indexName;

public class TestReadModelDescriptionProvider : IReadModelDescriptionProvider
{
Expand All @@ -81,46 +70,37 @@ public class TestReadModelDescriptionProvider : IReadModelDescriptionProvider

protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
{
try
{
_indexName = $"eventflow-test-{Guid.NewGuid():D}";

var testReadModelDescriptionProvider = new TestReadModelDescriptionProvider(_indexName);

var resolver = eventFlowOptions
.RegisterServices(sr =>
{
sr.RegisterType(typeof(ThingyMessageLocator));
sr.Register<IReadModelDescriptionProvider>(c => testReadModelDescriptionProvider);
})
.ConfigureElasticsearch(_elasticsearchInstance.Uri)
.UseElasticsearchReadModelFor<ThingyAggregate, ThingyId, ElasticsearchThingyReadModel>()
.UseElasticsearchReadModel<ElasticsearchThingyMessageReadModel, ThingyMessageLocator>()
.AddQueryHandlers(
typeof(ElasticsearchThingyGetQueryHandler),
typeof(ElasticsearchThingyGetVersionQueryHandler),
typeof(ElasticsearchThingyGetMessagesQueryHandler))
.CreateResolver();

_elasticClient = resolver.Resolve<IElasticClient>();

_elasticClient.CreateIndex(_indexName, c => c
.Settings(s => s
.NumberOfShards(1)
.NumberOfReplicas(0))
.Mappings(m => m
.Map<ElasticsearchThingyMessageReadModel>(d => d
.AutoMap())));

_elasticsearchInstance.WaitForGreenStateAsync().Wait(TimeSpan.FromMinutes(1));

return resolver;
}
catch
{
_elasticsearchInstance.DisposeSafe("Failed to dispose ES instance");
throw;
}
_elasticsearchUrl = Environment.GetEnvironmentVariable("ELASTICSEARCH_URL");
_indexName = $"eventflow-test-{Guid.NewGuid():D}";

var testReadModelDescriptionProvider = new TestReadModelDescriptionProvider(_indexName);

var resolver = eventFlowOptions
.RegisterServices(sr =>
{
sr.RegisterType(typeof(ThingyMessageLocator));
sr.Register<IReadModelDescriptionProvider>(c => testReadModelDescriptionProvider);
})
.ConfigureElasticsearch(_elasticsearchUrl)
.UseElasticsearchReadModelFor<ThingyAggregate, ThingyId, ElasticsearchThingyReadModel>()
.UseElasticsearchReadModel<ElasticsearchThingyMessageReadModel, ThingyMessageLocator>()
.AddQueryHandlers(
typeof(ElasticsearchThingyGetQueryHandler),
typeof(ElasticsearchThingyGetVersionQueryHandler),
typeof(ElasticsearchThingyGetMessagesQueryHandler))
.CreateResolver();

_elasticClient = resolver.Resolve<IElasticClient>();

_elasticClient.CreateIndex(_indexName, c => c
.Settings(s => s
.NumberOfShards(1)
.NumberOfReplicas(0))
.Mappings(m => m
.Map<ElasticsearchThingyMessageReadModel>(d => d
.AutoMap())));

return resolver;
}

[TearDown]
Expand Down
Loading

0 comments on commit 3e0c841

Please sign in to comment.