Adapter for MongoDB 9.12 | webMethods Adapter for MongoDB Documentation | webMethods Adapter for MongoDB Installation and User’s Guide Documentation | Adapter for MongoDB Connections | Configuring Adapter for MongoDB Connections
 
Configuring Adapter for MongoDB Connections
When you configure Adapter for MongoDB connections, you specify information that Integration Server uses to connect to a MongoDB system. You can configure Adapter for MongoDB connections either manually using the Integration Server Administrator screen.
*To configure an adapter connection
1. In the Adapters menu in Integration Server Administrator's navigation area. Click webMethods Adapter for MongoDB.
2. Click Configure New Connection on the Connections screen.
3. click webMethods Adapter for MongoDB Connection to display the Configure Connection Type screen.
4. In the webMethods Adapter for MongoDB section, use the following fields:
Field
Description/Action
Package Name
Name you want to give the package, that is used for creating connection in package.
You must create the package using Designer before you can specify the package using this parameter. For general information about creating packages, see the webMethods Service Development Help for your release.
Note:
Configure the connection in a user-defined package rather than in the adapter's package.
Connection Type
Name you want to give the connection. Connection names cannot have spaces or use special characters reserved by Integration Server and Designer. For more information about the use of special characters in package, folder, and element names, see the webMethods Service Development Help for your release.
5. In the Connection Properties section, use the following fields:
Field
Description/Action
Connection URL
Connection URL used to connect to MongoDB as described in the MongoDB documentation.
Connection URL syntax for MongoDB is mongodb://host:port/.
Connection URL syntax for MongoDB Atlas is mongodb+srv://host/. For example: mongodb+srv://cluster0.euv3f.mongodb.net/.
Database Name
Name of the database on which the operations are performed.
Authentication Mechanism
User authentication mode. Select one of the following authentication modes:
Default. You must provide values for the following fields:
*Authentication Database. Database name which holds the user credentials.
*User. User name that the connection uses to connect to MongoDB server.
*Password. Password for the user name.
*Retype Password. Retype the password you just entered.
X.509. You must provide values for the following fields:
*User. User name that the connection uses to connect to MongoDB server.
LDAP. You must provide values for the following fields:
*User. User name that the connection uses to connect to MongoDB server.
*Password. Password for the user name.
*Retype Password. Retype the password you just entered.
Kerberos. You must provide values for the following fields:
*User. User name that the connection uses to connect to MongoDB server.
*Other Authentication Mechanism Properties. Other properties required for Kerberos authentication.
None. No user authentication is required.
Read Preference
MongoDB supports the following read preferences:
*primary. All operations reads data from the current replica set.
*primaryPreferred. All the operation reads data from the primary replica set. The secondary members are preferred only if the primary member is unavailable.
*secondary. All operations reads data from the secondary members of replica set.
*secondaryPreferred. All operation reads data from the secondary replica set. The primary members are preferred only if secondary member is unavailable.
*nearest. All operations read from the members of replica set with the least network latency.
Read Concern
MongoDB supports the following read concerns:
*local. Returns without the guarantee of writing the data to a majority of member for a replica set.
*majority. Returns data that has acknowledged by a majority of replica set members.
*available. Returns without the guarantee of writing the data to a majority of member for a replica set.
*linearizable. Returns data that reflects all the successful majority acknowledged writes.
Write Concern
Type of write concern the connection provides. Uses specification as { w: <value>, j: <boolean>, wtimeout: <number> }.
Server Selection Timeout
Number of milliseconds the MongoDB driver waits for a server to raise an error if no server is selected.
Socket Connection Timeout(msec)
Time-out value in milliseconds to get the result for the query.
Note:
MongoDB driver throws an error if the query takes longer than the time-out value specified in the field.
Socket Read Timeout(msec)
Set the time-out limit for waiting to read data.
Enable SSL
Enables an SSL connection to the database. If SSL connection is enabled, then set the following fields:
*Invalid Hostname Allowed. Possible values are:
*true. Validates hostname certificates.
*false. Perform no validation of the certificates.
*Truststore Alias. Required. Alias for the truststore file configured in Integration Server.
*Keystore Alias. Required. Alias for keystore file configured in Integration Server for a two-way SSL authentication.
For more information about using keystores and truststores with Integration Server, see webMethods Integration Server Administrator’s Guide.
Note:
For Mongodb cloud connection, you must set Enable SSL to true.
Compression Set
Compresses the incoming and outgoing messages.
Note:
You can provide multiple values using a comma separator.
Required Replica Set
Specify the name of the replica set.
6. In the Connection Management Properties section, use the following fields:
Field
Description/Action
Enable Connection Pooling
Enables the connection to use connection pooling.
For more information about connection pooling, see Adapter Connections.
Note:
If you are planning to enable the connection pooling in a clustered environment, then consider the size of the connection pool. For details, see Considerations When Configuring Connections with Connection Pooling Enabled.
Minimum Pool Size
If connection pooling is enabled, this field specifies the number of connections to create when the connection is enabled.
The adapter will keep open the number of connections you configure here regardless of whether these connections become idle.
Maximum Pool Size
If connection pooling is enabled, this field specifies the maximum number of connections that can exist at one time in the connection pool.
Pool Increment Size
The password for the database user name specified in UserName.
If connection pooling is enabled, this field specifies the number of connections by which the pool will be incremented if connections are needed, up to the maximum pool size.
Block Timeout
If connection pooling is enabled, this field specifies the number of milliseconds that Integration Server will wait to obtain a connection with the database before it times out and returns an error.
For example, you have a pool with Maximum Pool Size of 20. If you receive 30 simultaneous requests for a connection, 10 requests will be waiting for a connection from the pool. If you set the Block Timeout to 5000, the 10 requests will wait for a connection for 5 seconds before they time out and return an error. If the services using the connections require 10 seconds to complete and return connections to the pool, the pending requests will fail and return an error message stating that no connections are available. If you set the Block Timeout value too high, you may encounter problems during error conditions. If a request contains errors that delay the response, other requests will not be sent. This setting should be tuned in conjunction with the Maximum Pool Size to accommodate such bursts in processing.
Expire Timeout
If connection pooling is enabled, this field specifies the number of milliseconds that an inactive connection can remain in the pool before it is closed and removed from the pool.
The connection pool will remove inactive connections until the number of connections in the pool is equal to the Minimum Pool Size. The inactivity timer for a connection is reset when the connection is used by the adapter. If you set the Expire Timeout value too high, you may have a number of unused inactive connections in the pool. This consumes local memory and a connection on your backend resource. This could have an adverse effect if your resource has a limited number of connections. If you set the Expire Timeout value too low, performance could degrade because of the increased activity of creating and closing connections. This setting should be tuned in conjunction with the Minimum Pool Size to avoid excessive opening/closing of connections during normal processing.
Startup Retry Count
The number of times that the system should attempt to initialize the connection pool at startup if the initial attempt fails.
The default is 0.
Startup Backoff Timeout
The number of seconds that the system should wait between attempts to initialize the connection pool.
7. Click Save Connection.
The connection you created appears on the adapter's Connections screen and in Designer. You can enable a connection only if the parameters for the connection are valid.