[ 
https://issues.apache.org/jira/browse/CAMEL-14258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16992547#comment-16992547
 ] 

Pasquale Congiusti edited comment on CAMEL-14258 at 12/13/19 7:58 AM:
----------------------------------------------------------------------

I started the development needed assuming that the new connection bean was 
going to be compatible with the older one: it's not. I have a couple of open 
points I'd like to discuss:

1. The [new connection 
bean|https://mongodb.github.io/mongo-java-driver/3.7/javadoc/?com/mongodb/client/MongoClient.html]
 is using a different interface and it does not expose all the information 
exposed by the [old 
one|https://mongodb.github.io/mongo-java-driver/3.7/javadoc/?com/mongodb/client/MongoClient.html].
 That means that any implementation won't be backward compatible. Would it be 
okey if we break this kind of compatibility in a minor release?

2. If we go ahead with the implementation we will have to let the user 
configure _WriteConcern_ and _ReadPreference_ properties by declaring them 
explicitly instead of expecting this configuration to be done by the connection 
bean like it's now. From development perspective this means that we should 
introduce a couple of endpoint properties and let the user declare those 
parameter explicitly (or fallback to default if missing).

I'd like some opinion before going ahead with the development. I've opened [a 
thread on mongodb-driver 
group|https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/mongodb-user/6t-1UD_Q83A/v_mgbu3mAQAJ]
 -without any answer so far: I don't expect any to be honest, as it seems that 
[those changes was not designed to be 
compatible|http://mongodb.github.io/mongo-java-driver/3.7/whats-new/#new-entry-point]-.
 The [old connection bean is deprecated in 3.12 
driver|https://mongodb.github.io/mongo-java-driver/3.12/javadoc/com/mongodb/Mongo.html].


was (Author: squakez):
I started the development needed assuming that the new connection bean was 
going to be compatible with the older one: it's not. I have a couple of open 
points I'd like to discuss:

1. The [new connection 
bean|https://mongodb.github.io/mongo-java-driver/3.7/javadoc/?com/mongodb/client/MongoClient.html]
 is using a different interface and it does not expose all the information 
exposed by the [old 
one|https://mongodb.github.io/mongo-java-driver/3.7/javadoc/?com/mongodb/client/MongoClient.html].
 That means that any implementation won't be backward compatible. Would it be 
okey if we break this kind of compatibility in a minor release?

2. If we go ahead with the implementation we will have to let the user 
configure _WriteConcern_ and _ReadPreference_ properties by declaring them 
explicitly instead of expecting this configuration to be done by the connection 
bean like it's now. From development perspective this means that we should 
introduce a couple of endpoint properties and let the user declare those 
parameter explicitly (or fallback to default if missing).

I'd like some opinion before going ahead with the development. I've opened [a 
thread on mongodb-driver 
group|https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/mongodb-user/6t-1UD_Q83A/v_mgbu3mAQAJ]
 without any answer so far: I don't expect any to be honest, as it seems that 
[those changes was not designed to be 
compatible|http://mongodb.github.io/mongo-java-driver/3.7/whats-new/#new-entry-point].

> [camel-mongodb] New MongoClient driver recommendations
> ------------------------------------------------------
>
>                 Key: CAMEL-14258
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14258
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Pasquale Congiusti
>            Assignee: Pasquale Congiusti
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Starting from version mongo-java-driver 3.7 version, the recommended way to 
> create a connection to MongoDB is using the [MongoClients 
> factory|https://mongodb.github.io/mongo-java-driver/3.7/javadoc/?com/mongodb/client/MongoClient.html]
>  which is finally returning a _com.mongodb.client.MongoClient_.
> We're originally using _com.mongodb.MongoClient_ class instead, so we should 
> switch to the new implementation to be aligned with the latest recommendation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to