dnvriend / akka-persistence-inmemory

Akka-persistence-inmemory is a plugin for akka-persistence that stores journal and snapshot messages memory, which is very useful when testing persistent actors, persistent FSM and akka cluster
Apache License 2.0
134 stars 41 forks source link

Issues using akka-persistence-memory with fun-cqrs #25

Closed saqibsaleem-ee closed 8 years ago

saqibsaleem-ee commented 8 years ago

Hi.

I am trying to use funCQRS with the inmemory backend but I am having some issues. The command side works fine and it seems that I can save data. What doesn't seem to work is the projection side and I was asked by the maintainer of funCQRS to check the config for the backend. From the docs it seems that the only config required is:

akka.persistence { journal.plugin = "inmemory-journal" snapshot-store.plugin = "inmemory-snapshot-store" }

Is this all the config needed?

Again funCQRS mentioned that we need another entry in the application.conf:

akka.persistence { tagger = "io.funcqrs.akka.DomainEventTagAdapter" }

But, I see no mention of this anywhere in the docs here.

Thanks in advance.

saqibsaleem-ee commented 8 years ago

Here is a sample project.

funcqrs-spike.zip

dnvriend commented 8 years ago

Hi,

I don't know fun-cqrs. The inmemory journal can be configured as stated on the readme.md. There was a typo in it because I copied the contents from the jdbc plugin which basically does the same. The configuration should be:

akka.persistence {
    journal.plugin = "inmemory-journal"
    snapshot-store.plugin = "inmemory-snapshot-store"
}

inmemory-journal {
  event-adapters {
    tagging = "com.github.dnvriend.TaggingEventAdapter"
  }
  event-adapter-bindings {
    "com.github.dnvriend.Person$PersonCreated" = tagging
    "com.github.dnvriend.Person$FirstNameChanged" = tagging
    "com.github.dnvriend.Person$LastNameChanged" = tagging
  }
}

The example was taken from the akka persistence demo project.