Skip to content

Commit

Permalink
Merge pull request #38 from AkkaNetContrib/dev
Browse files Browse the repository at this point in the history
Update to Akka 1.3.5, MongoDB Driver to 2.5.0 and .NET Standard support
  • Loading branch information
Aaronontheweb authored Mar 24, 2018
2 parents e14d408 + 13f7db9 commit d9572c3
Show file tree
Hide file tree
Showing 37 changed files with 1,085 additions and 961 deletions.
177 changes: 132 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
# Akka

# Fake directories
src/.build/**



#GitExtensions
us.stackdump

#KDiff3 and other git merge tools
*.orig

#-------------------------------------------------------------------------------
#Based on https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Custom
tools/
build/
.nuget/
.dotnet/
.idea/
.[Dd][Ss]_[Ss]tore

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

#MonoDevelop
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
Expand All @@ -32,19 +27,28 @@ us.stackdump
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

#FAKE
.fake
tools/

# Roslyn cache directories
*.ide/
#DocFx output
_site/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
# NUNIT
*.VisualState.xml
TestResult.xml

Expand All @@ -53,6 +57,12 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
*_p.c
*_i.h
Expand Down Expand Up @@ -85,14 +95,18 @@ _Chutzpah*
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/
Expand All @@ -105,7 +119,7 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
Expand All @@ -114,9 +128,14 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
Expand Down Expand Up @@ -144,37 +163,62 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment out the next line if you want to keep your passwords hidden
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
!**/packages/repositories.config
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Windows Azure Build Output
# Microsoft Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/
Expand All @@ -190,10 +234,7 @@ UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf

# make exception for Akka.Persistence.SqlServer database file
!AkkaPersistenceSqlServerSpecDb.mdf
!AkkaPersistenceSqlServerSpecDb_log.ldf
*.ndf

# Business Intelligence projects
*.rdl.data
Expand All @@ -202,15 +243,61 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/
/src/.Akka.boltdata/NCover/Executions/0.jf
/src/.Akka.boltdata/NCover/Executions/ProjectId/0.jf
/src/.Akka.boltdata/NCover/Executions/ProjectOrderIndex/0.jf
/src/.Akka.boltdata/NCover/Projects/0.jf
/src/.Akka.boltdata/NCover/Projects/Name/0.jf
/src/.Akka.boltdata/Settings.json
/src/.Akka.boltdata/TestResults.json
resetdev.bat
/src/packages/repositories.config

# FAKE build folder

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/

# Typescript v1 declaration files
typings/

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config

# Telerik's JustMock configuration file
*.jmconfig

# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
45 changes: 45 additions & 0 deletions Akka.Persistence.MongoDb.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.MongoDb", "src\Akka.Persistence.MongoDb\Akka.Persistence.MongoDb.csproj", "{E945AABA-2779-41E8-9B43-8898FFD64F22}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.MongoDb.Tests", "src\Akka.Persistence.MongoDb.Tests\Akka.Persistence.MongoDb.Tests.csproj", "{0F9B9BC6-9F86-40E8-BA9B-D27BF3AC7970}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Persistence.MongoDb.Tests.Performance", "src\Akka.Persistence.MongoDb.Tests.Performance\Akka.Persistence.MongoDb.Tests.Performance.csproj", "{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{BE1178E1-2069-4762-82E5-43805913DCB8}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
build.fsx = build.fsx
build.ps1 = build.ps1
build.sh = build.sh
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E945AABA-2779-41E8-9B43-8898FFD64F22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E945AABA-2779-41E8-9B43-8898FFD64F22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E945AABA-2779-41E8-9B43-8898FFD64F22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E945AABA-2779-41E8-9B43-8898FFD64F22}.Release|Any CPU.Build.0 = Release|Any CPU
{0F9B9BC6-9F86-40E8-BA9B-D27BF3AC7970}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F9B9BC6-9F86-40E8-BA9B-D27BF3AC7970}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F9B9BC6-9F86-40E8-BA9B-D27BF3AC7970}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F9B9BC6-9F86-40E8-BA9B-D27BF3AC7970}.Release|Any CPU.Build.0 = Release|Any CPU
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAE7CA7C-0D0C-4FDA-BDE9-BE16A27343EF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D4F3F966-EB9C-443A-8158-419703A68B92}
EndGlobalSection
EndGlobal
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ akka.persistence {
```

### Serialization
The events and snapshots are stored as BsonDocument, so you need to register you types with the BsonClassMap before you can use your persistence actor.
Otherwise the recovery will fail and you receive a RecoveryFailure with the message:
The events and snapshots are stored as BsonDocument. On the previous version of this driver you needed to register your types with BsonClassMap before you could use your persistence actor, otherwise the recovery would fail and you'd receive a RecoveryFailure with the message:
>An error occurred while deserializing the Payload property of class \<Journal or Snapshot class>: Unknown discriminator value '\<your type>'
#### **Since now, all types are registered automatically for you so you don't need to use BsonClassMap to serialize/deserialize your types!**

### Notice
- The MongoDB operator to limit the number of documents in a query only accepts an integer while akka provides a long as maximum for the loading of events during the replay. Internally the long value is cast to an integer and if the value is higher then Int32.MaxValue, Int32.MaxValue is used. So if you have stored more then 2,147,483,647 events for a single PersistenceId, you may have a problem :wink:
45 changes: 44 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,50 @@

#### 1.3.5 March 23 2018 ####
Support for Akka.Persistence 1.3.5.
Support for .NET Standard 1.6
Supports latest version of .NET MongoDB Driver.
You don't neeed to register/map your classes for serialization/deserialization anymore!

#### 1.1.0 July 30 2016 ####
Updated to Akka.Persistence 1.1.1

**Migration from 1.0.5 Up**
As of 1.1.0, the highest SequenceNr for each PersistenceId in the EventJournal collection is kept in a separate collection, Metadata.
This script creates the Metadata collection, then finds the highest SequenceNr for each persistence id from the EventJournal and adds it to the Metadata collection.

To run, save this to a JavaScript file, update {your_database_address} e.g. 127.0.0.1:27017/events. Run: mongo {file_name}.js
```javascript
try {
var db = connect('{your_database_address}');

var persistenceIds = db.EventJournal.distinct('PersistenceId');

persistenceIds.forEach(persistenceId => {
print('Finding highest SequenceNr for PersistenceId: ' + persistenceId);
var highestSequenceNr = db.EventJournal
.find({ PersistenceId: persistenceId }, { SequenceNr: true })
.sort({ SequenceNr: -1 })
.limit(1)
.next()
.SequenceNr;

print('Highest SequenceNr found ' + highestSequenceNr + ', inserting into Metadata table...');
db.Metadata.insertOne(
{
_id: persistenceId,
PersistenceId: persistenceId,
SequenceNr: highestSequenceNr
}
);

print('Inserted successfully');
});
} catch(e) {
print(e);
}
```

#### 1.0.5 August 08 2015 ####

#### 1.0.4 August 07 2015 ####
Initial release of Akka.Persistence.MongoDb
Initial release of Akka.Persistence.MongoDb
Loading

0 comments on commit d9572c3

Please sign in to comment.