Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement EventsByTag in javadsl.PersistenceTestKitReadJournal.scala #1762

Open
olijaun opened this issue Feb 6, 2025 · 4 comments
Open

Comments

@olijaun
Copy link

olijaun commented Feb 6, 2025

Hi

I wanted to Query events by tag using EventsByTag with org.apache.pekko.persistence.testkit.query.javadsl.PersistenceTestKitReadJournal. Unfortunately this interface is not implemented yet. The scala-Version does implement EventsByTag. Is there a specific reason for this? As far as I can tell (I'm no Scala-Developer) one could simply add an additional delegate method.

I also saw that the org.apache.pekko.persistence.testkit.query.scaladsl.PersistenceTestKitReadJournal does not support specifying an offset other than NoOffset. This will probably be my next issue...

What I actually want to do is to replace io.github.alstanchev.pekko.persistence.inmemory.query.javadsl.InMemoryReadJournal with something that is included in the "standard" pekko libs. Is there another option? I saw that there is a org.apache.pekko.persistence.journal.inmem.InmemJournal but I could not figure out how I'm supposed to use that. How would I configure that in application.conf?

Thanks and regards
Oliver

@pjfanning
Copy link
Contributor

pjfanning commented Feb 8, 2025

The Java DSL can often have a few missing features - mainly due to an oversight. In particular, EventsByTag support was only added recently to the Scala DSL PersistenceTestKitReadJournal - #1532.
I have added #1763 but will need to get back to it to add a test or 2.
There seem to be a few more missing interfaces too.

@pjfanning
Copy link
Contributor

pjfanning commented Feb 8, 2025

From the Javadoc of InMemJournal.

 * InmemJournal is only intended to be used for tests and therefore binary backwards compatibility
 * of the published messages are not guaranteed.

I think if you are going to use a persistence framework, that you should use real persistence (JDBC, Cassandra, DynamoDB, etc).

@pjfanning
Copy link
Contributor

I created #1765

@olijaun
Copy link
Author

olijaun commented Feb 17, 2025

Thanks a lot for your answers and work @pjfanning.

I use the io.github.alstanchev.pekko.persistence.inmemory.query.javadsl.InMemoryReadJournal only for testing. I use pekko-persistence-jdbc for my application. There is currently no Version for Pekko 1.1.3 of the InMemoryReadJournal and it's a bit tedious to add the dependencies to make it working. That's why I thought it would be nice to have something that comes directly with Pekko. But of course I can live with that for the moment :-) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants