You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Babak Vahdat (JIRA)" <ji...@apache.org> on 2014/04/15 22:58:18 UTC

[jira] [Commented] (CAMEL-7370) camel-mongodb - Should close the underlying physical connection to MongoDB when stopping

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

Babak Vahdat commented on CAMEL-7370:
-------------------------------------

The idea is simply to override the {{doStop()}} method in {{MongoDbEndpoint}} as following:

{code}
/**
 * Closes the underlying physical connection to MongoDB
 */
@Override
protected void doStop() throws Exception {
    if (mongoConnection != null) {
        LOG.debug("closing the connection {} on {}", mongoConnection, this);
        mongoConnection.close();
    }

    super.doStop();
}
{code}

By applying such a change all the tests would still pass and one can see less connections being hold open on the MongoDB server side (as the server logs into the console). But as we use a [single connection|https://github.com/apache/camel/blob/master/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbComponent.java#L43] at the component level, I’m not really sure if such a change would have a side effect on the productive applications running out there. 

> camel-mongodb - Should close the underlying physical connection to MongoDB when stopping
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-7370
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7370
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-mongodb
>    Affects Versions: 2.13.0
>            Reporter: Babak Vahdat
>            Assignee: Babak Vahdat
>            Priority: Minor
>             Fix For: 2.12.4, 2.13.1, 2.14.0
>
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)