You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (JIRA)" <ji...@apache.org> on 2016/12/04 08:47:58 UTC

[jira] [Commented] (CAMEL-10554) camel-mongodb evolution to driver 3

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

Andrea Cosentino commented on CAMEL-10554:
------------------------------------------

I was looking at the patch

{code}
+//    /**
+//     * Check if outputType is compatible with operation. DbCursor and DBObjectList applies to findAll. DBObject applies to others.
+//     */
+//    private void validateOutputType() {
+//        if (!ObjectHelper.isEmpty(outputType)) {
+//            if (MongoDbOutputType.DBObjectList.equals(outputType) && !(MongoDbOperation.findAll.equals(operation))) {
+//                throw new IllegalArgumentException("outputType DBObjectList is only compatible with operation findAll");
+//            }
+//            if (MongoDbOutputType.DBCursor.equals(outputType) && !(MongoDbOperation.findAll.equals(operation))) {
+//                throw new IllegalArgumentException("outputType DBCursor is only compatible with operation findAll");
+//            }
+//            if (MongoDbOutputType.DBObject.equals(outputType) && (MongoDbOperation.findAll.equals(operation))) {
+//                throw new IllegalArgumentException("outputType DBObject is not compatible with operation findAll");
+//            }
+//        }
+//    }
{code}

I see you're commenting this method and also

{code}
+//        if (writeConcern != null) {
+//            mongoConnection.setWriteConcern(writeConcern);
+//        } else if (writeConcernRef != null) {
+//            mongoConnection.setWriteConcern(writeConcernRef);
+//        }
+//
+//        // Set the ReadPreference
+//        if (readPreference != null) {
+//            mongoConnection.setReadPreference(readPreference);
+//        }
{code}

the writeConcern settings. These parameter are URI params from the endpoint configuration, so if we don't need the anymore maybe we have to deprecate them or remove them, but I think it is just because this patch is work in progress. 

Since this seems to be a big change in the component, may I ask you to open a Pull Request on Github if you can? This way we can review the code in an easier way. If you can't I'll wait for the complete patch.

> camel-mongodb evolution to driver 3
> -----------------------------------
>
>                 Key: CAMEL-10554
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10554
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 2.19.0
>            Reporter: Terrien Jean-Yves
>            Priority: Minor
>         Attachments: mongo3.patch
>
>
> Hi, 
> The mongodb driver has changed in its foundation. 
> It is recommended not to use many classes of the verion 2 still present in the driver. 
> This is the case with DBObject, which is the basis for the configuration of the camel component. 
> I'm working on the evolution of this component to use the new classes of version 3, like "Document". 
> I've created à patch (no completed)
> A+JYT
> Ps: how I can post the patch ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)