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

support mongodb for scala3 #150

Open
pjfanning opened this issue Jun 9, 2023 · 9 comments
Open

support mongodb for scala3 #150

pjfanning opened this issue Jun 9, 2023 · 9 comments
Labels
help wanted Extra attention is needed scala3 Scala 3 support

Comments

@pjfanning
Copy link
Contributor

pjfanning commented Jun 9, 2023

  • continuing to use mongodb-scala-driver causes problems because Scala 3 support for it is blocked by https://jira.mongodb.org/browse/JAVA-4181
    • the mongodb-scala-driver uses scala 2 macros (BSON macros)
  • one potential workaround is to change the compile dependencies to use mongodb-driver-reactivestreams instead of mongodb-scala-driver
    • the runtime code does not use the Scala specific mongodb classes
    • the Scala specific mongodb are used in tests though - the scala tests could be removed or only run with Scala2
    • Scala 3 users who want to use the mongodb connector would need to use Java classes to bind because mongodb-scala-driver has the code to support case classes, etc.
  • maybe a better solution is to change to using https://github.com/ReactiveMongo/ReactiveMongo/
@pjfanning pjfanning added blocked help wanted Extra attention is needed scala3 Scala 3 support and removed blocked labels Jun 9, 2023
@bdoyle0182
Copy link

bdoyle0182 commented Jul 15, 2023

maybe not the right place to chime in, but would porting reactivemongo-akkastream to have a pekko version apply here? I'm trying to coordinate on getting a pekko version of akka-persistence-mongo which was never an official akka connector. The one major blocker I can see is it depends on reactivemongo-akkastream otherwise the only other thing it uses is akka core which is now already covered by pekko core 1.0.0

@pjfanning
Copy link
Contributor Author

maybe not the right place to chime in, but would porting reactivemongo-akkastream to have a pekko version apply here? I'm trying to coordinate on getting a pekko version of akka-persistence-mongo which was never an official akka connector. The one major blocker I can see is it depends on reactivemongo-akkastream otherwise the only other thing it uses is akka core which is now already covered by pekko core 1.0.0

If you or anyone else wants to fork reactivemongo to support pekko or submit a patch to reactivemongo that would be very helpful.

My personal preference would be to do this outside of the Pekko project - which has plenty of code to manage as it is.

@pjfanning
Copy link
Contributor Author

@bdoyle0182
Copy link

I started working on adding a pekkostream module to the reactivemongo streaming repo in a fork. I think I've done everything I can, pretty straight forward, but since the core project this repo is dependent on is built using akka it would require cutting over the core reactivemongo repo to pekko and buy in from the reactivemongo team.

@mdedetrich
Copy link
Contributor

I started working on adding a pekkostream module to the reactivemongo streaming repo in a fork. I think I've done everything I can, pretty straight forward, but since the core project this repo is dependent on is built using akka it would require cutting over the core reactivemongo repo to pekko and buy in from the reactivemongo team.

So the current pekko-connectors mongo driver has been udpated to work within Pekko but I think going forward it works out it makes sense to support a pekko version of reactive-mongo as its own project in the same vain as how we have pekko-connectors-kafka.

@pjfanning
Copy link
Contributor Author

I started working on adding a pekkostream module to the reactivemongo streaming repo in a fork. I think I've done everything I can, pretty straight forward, but since the core project this repo is dependent on is built using akka it would require cutting over the core reactivemongo repo to pekko and buy in from the reactivemongo team.

So the current pekko-connectors mongo driver has been udpated to work within Pekko but I think going forward it works out it makes sense to support a pekko version of reactive-mongo as its own project in the same vain as how we have pekko-connectors-kafka.

This is covered by ReactiveMongo/ReactiveMongo#1245

@mdedetrich
Copy link
Contributor

mdedetrich commented Aug 19, 2023

This is covered by ReactiveMongo/ReactiveMongo#1245

I see, I had a quick look at the project and it just provides the basic driver however what the current pekko-connectors mongodb provides is also Pekko Streams integration (i.e. Source/Sink/Flow) so once this is released then we should either update the current pekko-connectors mongodb module to use reactive mongo (as a breaking change) or my previous suggestion which would be to create a pekko-connectors-mongodb which uses ReactiveMongo underneath and deprecate the current mongodb module

@pjfanning
Copy link
Contributor Author

Yes, a new connector and deprecating the existing one may be a tidier approach

@mdedetrich
Copy link
Contributor

Yes, a new connector and deprecating the existing one may be a tidier approach

Agreed, although I think the determining factor is whether the Stream API would be any different, i.e. it might be that the structure and types of the Flow/Sink/Source would be the same even with the reactive mongo driver in which case it might be fine to just do a major update in the current pekko-connectors mongo module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed scala3 Scala 3 support
Projects
None yet
Development

No branches or pull requests

3 participants