akka-persistence-inmemory icon indicating copy to clipboard operation
akka-persistence-inmemory copied to clipboard

Improve doc for Java

Open olijaun opened this issue 5 years ago • 3 comments

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.

olijaun avatar Sep 30 '19 11:09 olijaun

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 avatar Sep 30 '19 14:09 BeatSager

@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 ;-)

olijaun avatar Nov 12 '19 09:11 olijaun

@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 ?

BeatSager avatar Nov 18 '19 08:11 BeatSager