akka-persistence-inmemory
akka-persistence-inmemory copied to clipboard
Improve doc for Java
As a beginner with AKKA (using javadsl) I had some troubles sending the "ClearJournal" message to the in-memory-store. Currently it seems not to be possible to do this with a proper Java-API. I had to use some strange "$"-classes (at least for me because I don't know Scala).
The documentation should be improved with a "full" example:
TestProbe tp = new TestProbe(akkaSetup.actorSystem());
StorageExtensionImpl extension = (StorageExtensionImpl) StorageExtension.get(akkaSetup.actorSystem());
ActorRef actorRef = extension.journalStorage();
InMemoryJournalStorage.ClearJournal$ myvar = InMemoryJournalStorage.ClearJournal$.MODULE$;
tp.send(actorRef, myvar);
tp.expectMsg(new Status.Success(""));
Also I'm not really sure about the versions. In maven I have 2.5.15.2 configured. However the latest version in github is 2.5.15.1.
Using scala case objects in java code is quite ugly. Instead of adding this to the documentation I would propose to solve this in the api by either not use case objects but empty case classes (will be warned in scala) or add some functions returning this objects.
@BeatSager Yes, sure. I just think that until it is solved in the API the next best thing is to have it in the doc ;-)
@dnvriend I could change the api and prepare a pull request. What do you think about it? Do you already know when you plan to go drop support for akka 2.4 https://github.com/dnvriend/akka-persistence-inmemory/issues/57 ?