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
DATAMONGO-2427 - Upgrade to MongoDB Driver 4.0 Snapshot #823
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
christophstrobl
force-pushed
the
issue/DATAMONGO-2427
branch
4 times, most recently
from
January 20, 2020 13:59
3b019de
to
e6d4054
Compare
This change switches to the MongoDB 4.0 driver and introduces configuration options for com.mongodb.client.MongoClient. The XML namespace changed from client-options to client-settings and removed already deprecated elements and attributes. Imports are switched from single artifact uber jar to split imports for driver-core, -sync and -reactivestreams. Deprecations have been removed.
Rename to follow MongoDB's naming scheme. Re-introduce deprecated MongoDbFactory to aid migration.
Replace leftovers to Mongo 2.x API with Document and MongoDatabase references and tweak Javadoc. Reorder field declarations to class header. Reflect 3.0 versions in schema configuration. Add TODO markers to disabled tests. Reflect changes in documentation. Enable disabled test.
…ublisher API and introduce UUID format configuration options. Move from AsyncInputStream handling to Publisher for GridFS. UUID types require additional configuration setup to prevent errors while processing legacy (type 3) binary types. We still use type 3 as default but allow codec configuration for type 4 via Java and XML configuration. Updated migration guide.
Enable disabled tests. Adapt to ReactiveGridFS changes. Use WriteConcern.MAJORITY in tests.
mp911de
force-pushed
the
issue/DATAMONGO-2427
branch
from
January 27, 2020 09:09
e6d4054
to
c74cda1
Compare
mp911de
force-pushed
the
issue/DATAMONGO-2427
branch
from
January 27, 2020 10:42
cc2dfd5
to
075e6ac
Compare
mp911de
pushed a commit
that referenced
this pull request
Jan 27, 2020
This change switches to the MongoDB 4.0 driver and introduces configuration options for com.mongodb.client.MongoClient. The XML namespace changed from client-options to client-settings and removed already deprecated elements and attributes. Imports are switched from single artifact uber jar to split imports for driver-core, -sync and -reactivestreams. Deprecations have been removed. Original pull request: #823.
mp911de
added a commit
that referenced
this pull request
Jan 27, 2020
Rename to follow MongoDB's naming scheme. Re-introduce deprecated MongoDbFactory to aid migration. Original pull request: #823.
mp911de
added a commit
that referenced
this pull request
Jan 27, 2020
Replace leftovers to Mongo 2.x API with Document and MongoDatabase references and tweak Javadoc. Reorder field declarations to class header. Reflect 3.0 versions in schema configuration. Add TODO markers to disabled tests. Reflect changes in documentation. Enable disabled test. Original pull request: #823.
mp911de
pushed a commit
that referenced
this pull request
Jan 27, 2020
…ublisher API and introduce UUID format configuration options. Move from AsyncInputStream handling to Publisher for GridFS. UUID types require additional configuration setup to prevent errors while processing legacy (type 3) binary types. We still use type 3 as default but allow codec configuration for type 4 via Java and XML configuration. Updated migration guide. Original pull request: #823.
mp911de
added a commit
that referenced
this pull request
Jan 27, 2020
Enable disabled tests. Adapt to ReactiveGridFS changes. Use WriteConcern.MAJORITY in tests. Original pull request: #823.
mp911de
added a commit
that referenced
this pull request
Jan 27, 2020
Guard tests. Original pull request: #823.
That's merged and polished now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This⚠️ breaking ⚠️ change switches to the MongoDB 4.0 driver and introduces configuration options for
com.mongodb.client.MongoClient
.The XML namespace changes from
client-options
toclient-settings
and removes already deprecated elements and attributes.Imports are switched from single artifact uber jar (
mongo-java-driver
) to split imports fordriver-core
,-sync
and-reactivestreams
(one of the latter 2 required).API deprecations from previous versions have now been removed.
Changed Java API
MongoClientFactoryBean
com.mongodb.client.MongoClient
instead ofcom.mongodb.MongoClient
. UsesMongoClientSettings
instead ofMongoClientOptions
.MongoDataIntegrityViolationException
WriteConcernResult
instead ofWriteResult
.BulkOperationException
MongoBulkWriteException
andcom.mongodb.bulk.BulkWriteError
instead ofBulkWriteException
andcom.mongodb.BulkWriteError
ReactiveMongoClientFactoryBean
com.mongodb.MongoClientSettings
instead ofcom.mongodb.async.client.MongoClientSettings
ReactiveMongoClientSettingsFactoryBean
com.mongodb.MongoClientSettings
instead ofcom.mongodb.async.client.MongoClientSettings
Removed Java API
MongoClientOptionsFactoryBean
MongoClientSettingsFactoryBean
com.mongodb.MongoClientSettings
.AbstractMongoConfiguration
AbstractMongoClientConfiguration
(Available since 2.1)com.mongodb.client.MongoClient
.MongoDbFactory#getLegacyDb()
SimpleMongoDbFactory
SimpleMongoClientDbFactory
(Available since 2.1)MapReduceOptions#getOutputType()
MapReduceOptions#getMapReduceAction()
MapReduceAction
instead ofMapReduceCommand.OutputType
.Meta|Query
maxScan & snapshotChanged XML Namespace Elements and Attributes:
<mongo:mongo-client />
com.mongodb.MongoClient
com.mongodb.client.MongoClient
<mongo:mongo-client replica-set="..." />
<mongo:client-settings cluster-hosts="..." />
instead<mongo:db-factory writeConcern="..." />
Removed XML Namespace Elements and Attributes:
<mongo:db-factory mongo-ref="..." />
<mongo:db-factory mongo-client-ref="..." />
com.mongodb.client.MongoClient
.<mongo:mongo-client credentials="..." />
<mongo:mongo-client credential="..." />
<mongo:client-options />
<mongo:client-settings />
com.mongodb.MongoClientSettings
for details.New XML Namespace Elements and Attributes:
<mongo:db-factory mongo-client-ref="..." />
<mongo:db-factory mongo-ref="..." />
<mongo:db-factory connection-string="..." />
uri
andclient-uri
.<mongo:mongo-client connection-string="..." />
uri
andclient-uri
.<mongo:client-settings />
com.mongodb.MongoClientSettings
.UUID Type Changes
The MongoDB UUID representation can now be configured with different formats.
This has to be done via
MongoClientSettings
as shown in the snippet below.Supersedes: #812