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

Mongo: Change to mongo-scala-driver 4.1.1 #2307

Merged
merged 6 commits into from
Nov 9, 2020
Merged

Mongo: Change to mongo-scala-driver 4.1.1 #2307

merged 6 commits into from
Nov 9, 2020

Conversation

mikela
Copy link
Contributor

@mikela mikela commented May 8, 2020

Update mongo-scala-driver to latest version (4.0.3)

@lightbend-cla-validator
Copy link

At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

@probot-autolabeler probot-autolabeler bot added dependency-change For PRs changing the version of a dependency. p:mongodb labels May 8, 2020
@mikela
Copy link
Contributor Author

mikela commented May 8, 2020

CLA signed.

@ennru ennru added this to the 3.0.0 milestone May 11, 2020
@ennru
Copy link
Member

ennru commented May 11, 2020

Thank you @mikela for opening this PR. I'm sorry, but it came a little bit too late to make it into Alpakka 2.0 and we don't want to change dependencies within patch releases.
As this is quite a jump with changed APIs and everything, we'll have to wait until Alpakka 3.0 before merging.
But I believe we'll see more library upgrades piling up and might release 3.0 by end of 2020.

@mikela
Copy link
Contributor Author

mikela commented May 11, 2020

Sounds good! Thanks!

@agemooij
Copy link
Contributor

agemooij commented Jun 9, 2020

Hi @ennru . Any chance this will be released earlier than end of year? I'd like to contribute some extra work on top of this PR, e.g. to add additional overloads of the APIs that take the new Scala-specific classes, which also implement the Reactive Streams APIs, so I can avoid this:

Screen Shot 2020-06-09 at 23 02 25

Thanks,
Age

@ennru
Copy link
Member

ennru commented Jun 10, 2020

Hi @agemooij,

I'm afraid that's unlikely. We'll do the major release when enough things accumulate which would break APIs or include major dependency changes. As we just did Alpakka 2.0 it will take a while.

@agemooij
Copy link
Contributor

Thanks @ennru . I'll try with the non-Scala APIs but still with the 4.x dependencies and see what happens.

@mikela
Copy link
Contributor Author

mikela commented Jun 10, 2020

Hi @agemooij,

Since this was a very simple PR you could just copy my changes by hand and make your own PR with your changes*. Then, if your PR is accepted, we can just discard this one.

You can probably work with v.4.1.0-beta2, it has some nice improvements and it will be come out of beta soon™.

*Alternatively you could fork my fork, do a PR there etc, but it's not worth it for just a few lines of code.

@agemooij
Copy link
Contributor

Hi @mikela . For now I've reverted back to using the 1.13.1 version of the reactive driver since any other combination involving the 4.x versions of the driver resulted in API mismatches, either at compile time or at runtime.

The thing with the 4.x version of the driver is that they actually have Java and Scala versions of the reactive APIs, so for a future version of the Alpakka driver we can use the Java one for the javadsl implementation and the Scala version for the scaladsl.

I'll see if I get around to providing a PR for the above but of course the urgency is gone a little bit if we can't get it released any time soon.

@mikela mikela changed the title Mongo: Update driver to 4.0.3 Mongo: Update driver to 4.1.0 Aug 10, 2020
@mikela
Copy link
Contributor Author

mikela commented Aug 10, 2020

Hi @ennru, I updated this PR with the newer version of the Mongo driver. Not sure if 85cf76c (I pulled the changes from the Alpakka project to my fork) affects the approval in any way. If so I can just discard this PR and make a new one. Thanks!

@@ -340,8 +340,7 @@ object Dependencies {

val MongoDb = Seq(
libraryDependencies ++= Seq(
"org.mongodb" % "mongodb-driver-reactivestreams" % "1.12.0", // ApacheV2
"org.mongodb.scala" %% "mongo-scala-bson" % "2.7.0" % "test" // ApacheV2
"org.mongodb.scala" %% "mongo-scala-driver" % "4.1.0" // ApacheV2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are ready for Alpakka 3.0 merges now!
There is a later release of the Mongo driver (4.1.1).
What's the value-add of mongo-scala-driver compared to mongodb-driver-reactivestreams and mongo-scala-bson as used before?

Copy link
Contributor

@agemooij agemooij Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ennru AFAIK, the main 4.x Java driver lib now has all APIs in the same distribution package. The separate Scala driver, Scala bson, and reactivestreams driver have been discontinued during the release of their 4.x driver.

The main driver page describes that here: https://mongodb.github.io/mongo-java-driver/

It's been a while again now that I looked at the detailed differences but judging from my own comments above the migration process is mostly one of changing the imported packages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old driver has been superseded by the new one. According to the driver compatibility table, only the new driver is compatible with MongoDB 4.4+.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this references. Please add them in a comment for later reference.
Please update even the docs page in mongodb.md with appropriate links to give information about the driver and compatible MongoDB versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Not sure if by add them in a comment you mean here on this PR or somewhere else.
  • mongodb.md updated with information about the new driver.
    Regarding this doc, I'd remove the Alternative connector section as it is not compatible with MongoDB version 4.4, at least for now. I haven't removed it just in case you want to keep it for other reasons.
    Thanks!

@mikela mikela changed the title Mongo: Update driver to 4.1.0 Mongo: Update driver to 4.1.1 Oct 26, 2020
@mikela
Copy link
Contributor Author

mikela commented Oct 27, 2020

The new MongoDB Java Driver is compatible with all MongoDB releases from versions 2.6 to 4.4, unlike the old one, which is not compatible with MongoDB 4.4.

Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ennru ennru changed the title Mongo: Update driver to 4.1.1 Mongo: Change to mongo-scala-driver 4.1.1 Nov 9, 2020
@ennru ennru merged commit 9e5e57b into akka:master Nov 9, 2020
@ennru
Copy link
Member

ennru commented Nov 9, 2020

Thank you! We're ramping up for Alpakka 3 now.

@robert-blankenship
Copy link

Any timeline on when Alpakka 3 will be released? My team is struggling with some incompatibility issues related to the outdated Mongo driver

@mikela
Copy link
Contributor Author

mikela commented Jan 15, 2021

@robert-blankenship I'm not part of Lightbend so I have no idea but if you need to use the new Mongo driver now you can use a snapshot version of Alpakka, like 2.0.2+46-a1f2cf02. I suggest you test it first but the Mongo code in that snapshot version (or above) is most likely the same code Alpakka 3 will have. You can see more versions here https://bintray.com/akka/snapshots/alpakka (perhaps you knew already but also for other users). Cheers!

@ennru
Copy link
Member

ennru commented Jan 20, 2021

Sorry for the delay, we at Lightbend don't have much time to spend on Alpakka for the time being.

I hope the snapshot works for you, we might be able to do a M1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency-change For PRs changing the version of a dependency. p:mongodb
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants