Class MongoDbEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.mongodb.MongoDbEndpoint
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.ComponentAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.19.0",
scheme="mongodb",
title="MongoDB",
syntax="mongodb:connectionBean",
category=DATABASE,
headersClass=MongoDbConstants.class)
public class MongoDbEndpoint
extends org.apache.camel.support.DefaultEndpoint
Perform operations on MongoDB documents and collections.
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Consumer
createConsumer
(org.apache.camel.Processor processor) List
<org.bson.conversions.Bson> Create technical list indexorg.apache.camel.Producer
protected void
doStart()
void
ensureIndex
(com.mongodb.client.MongoCollection<org.bson.Document> aCollection, List<org.bson.conversions.Bson> dynamicIndex) Add Indexlong
com.mongodb.client.model.changestream.FullDocument
getHosts()
com.mongodb.client.MongoCollection
<org.bson.Document> com.mongodb.client.MongoClient
com.mongodb.client.MongoDatabase
com.mongodb.ReadPreference
com.mongodb.WriteConcern
void
Initialises the MongoDB connection using the Mongo object provided to the endpointboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isTls()
boolean
boolean
void
setAppName
(String appName) Sets the logical name of the application.void
setAuthSource
(String authSource) The database name associated with the user's credentials.void
setCollection
(String collection) Sets the name of the MongoDB collection to bind to this endpointvoid
setCollectionIndex
(String collectionIndex) Sets the collection index (JSON FORMAT : { "field1" : order1, "field2" : order2})void
setCompressors
(String compressors) Specifies one or more compression algorithms that the driver will attempt to use to compress requests sent to the connected MongoDB instance.void
setConnectionBean
(String connectionBean) Name ofMongoClient
to use.void
setConnectTimeoutMS
(Integer connectTimeoutMS) Specifies the maximum amount of time, in milliseconds, the Java driver waits for a connection to open before timing out.void
setConsumerType
(String consumerType) Consumer type.void
setCreateCollection
(boolean createCollection) Create collection during initialisation if it doesn't exist.void
setCursorRegenerationDelay
(long cursorRegenerationDelay) MongoDB tailable cursors will block until new data arrives.void
setDatabase
(String database) Sets the name of the MongoDB database to targetvoid
setDbConsumerType
(String dbConsumerType) Reserved for future use, when more consumer types are supported.void
setDirectConnection
(boolean directConnection) Specifies that the driver must connect to the host directly.void
setDynamicity
(boolean dynamicity) Sets whether this endpoint will attempt to dynamically resolve the target database and collection from the incoming Exchange properties.void
setFullDocument
(com.mongodb.client.model.changestream.FullDocument fullDocument) Specifies whether changeStream consumer include a copy of the full document when modified by update operations.void
setHeartbeatFrequencyMS
(Integer heartbeatFrequencyMS) heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment.void
Host address of mongodb server in `[host]:[port]` format.void
setLoadBalanced
(boolean loadBalanced) If true the driver will assume that it's connecting to MongoDB through a load balancer.void
setLocalThresholdMS
(Integer localThresholdMS) The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances.void
setMaxConnecting
(Integer maxConnecting) Specifies the maximum number of connections a pool may be establishing concurrently.void
setMaxIdleTimeMS
(Integer maxIdleTimeMS) Specifies the maximum amount of time, in milliseconds, the Java driver will allow a pooled connection to idle before closing the connection.void
setMaxLifeTimeMS
(Integer maxLifeTimeMS) Specifies the maximum amount of time, in milliseconds, the Java driver will continue to use a pooled connection before closing the connection.void
setMaxPoolSize
(Integer maxPoolSize) The maximum number of connections in the connection pool.void
setMaxStalenessSeconds
(Integer maxStalenessSeconds) Specifies, in seconds, how stale a secondary can be before the driver stops communicating with that secondary.void
setMinPoolSize
(Integer minPoolSize) Specifies the minimum number of connections that must exist at any moment in a single connection pool.void
setMongoConnection
(com.mongodb.client.MongoClient mongoConnection) Sets the Mongo instance that represents the backing connectionvoid
setOperation
(String operation) Sets the operation this endpoint will execute against MongoDB.void
setOperation
(MongoDbOperation operation) Sets the operation this endpoint will execute against MongoDB.void
setOutputType
(MongoDbOutputType outputType) Convert the output of the producer to the selected type : DocumentList Document or MongoIterable.void
setPassword
(String password) User password for mongodb connectionvoid
setPersistentId
(String persistentId) One tail tracking collection can host many trackers for several tailable consumers.void
setPersistentTailTracking
(boolean persistentTailTracking) Enable persistent tail tracking, which is a mechanism to keep track of the last consumed message across system restarts.void
setReadPreference
(String readPreference) Configure how MongoDB clients route read operations to the members of a replica set.void
setReadPreferenceTags
(String readPreferenceTags) A representation of a tag set as a comma-separated list of colon-separated key-value pairs, e.g.void
setReplicaSet
(String replicaSet) Specifies that the connection string provided includes multiple hosts.void
setRetryReads
(boolean retryReads) Specifies that the driver must retry supported read operations if they fail due to a network error.void
setRetryWrites
(boolean retryWrites) Specifies that the driver must retry supported write operations if they fail due to a network error.void
setServerSelectionTimeoutMS
(Integer serverSelectionTimeoutMS) Specifies how long (in milliseconds) to block for server selection before throwing an exception.void
setSocketTimeoutMS
(Integer socketTimeoutMS) Specifies the maximum amount of time, in milliseconds, the Java driver will wait to send or receive a request before timing out.void
setSrvMaxHosts
(Integer srvMaxHosts) The maximum number of hosts from the SRV record to connect to.void
setSrvServiceName
(String srvServiceName) Specifies the service name of the SRV resource recordsthe driver retrieves to construct your seed list.void
setStreamFilter
(String streamFilter) Filter condition for change streams consumer.void
setTailTrackCollection
(String tailTrackCollection) Collection where tail tracking information will be persisted.void
setTailTrackDb
(String tailTrackDb) Indicates what database the tail tracking mechanism will persist to.void
setTailTrackField
(String tailTrackField) Field where the last tracked value will be placed.void
setTailTrackIncreasingField
(String tailTrackIncreasingField) Correlation field in the incoming record which is of increasing nature and will be used to position the tailing cursor every time it is generated.void
setTls
(boolean tls) Specifies that all communication with MongoDB instances should use TLS.void
setTlsAllowInvalidHostnames
(boolean tlsAllowInvalidHostnames) Specifies that the driver should allow invalid hostnames in the certificate for TLS connections.void
setUsername
(String username) Username for mongodb connectionvoid
setWaitQueueTimeoutMS
(Integer waitQueueTimeoutMS) Specifies the maximum amount of time, in milliseconds that a thread may wait for a connection to become available.void
setWriteConcern
(String writeConcern) Configure the connection bean with the level of acknowledgment requested from MongoDB for write operations to a standalone mongod, replicaset or cluster.void
setWriteResultAsHeader
(boolean writeResultAsHeader) In write operations, it determines whether instead of returning WriteResult as the body of the OUT message, we transfer the IN message to the OUT and attach the WriteResult as a header.void
setZlibCompressionLevel
(Integer zlibCompressionLevel) Specifies the degree of compression that Zlib should use to decrease the size of requests to the connected MongoDB instance.Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.ComponentAware
getComponent
Methods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducer
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
MongoDbEndpoint
public MongoDbEndpoint() -
MongoDbEndpoint
-
-
Method Details
-
createProducer
public org.apache.camel.Producer createProducer() -
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
initializeConnection
Initialises the MongoDB connection using the Mongo object provided to the endpoint- Throws:
CamelMongoDbException
-
ensureIndex
public void ensureIndex(com.mongodb.client.MongoCollection<org.bson.Document> aCollection, List<org.bson.conversions.Bson> dynamicIndex) Add Index- Parameters:
aCollection
-
-
createIndex
Create technical list index- Returns:
- technical list index
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
getConnectionBean
-
setConnectionBean
Name ofMongoClient
to use. -
setCollection
Sets the name of the MongoDB collection to bind to this endpoint- Parameters:
collection
- collection name
-
getCollection
-
setCollectionIndex
Sets the collection index (JSON FORMAT : { "field1" : order1, "field2" : order2}) -
getCollectionIndex
-
setOperation
Sets the operation this endpoint will execute against MongoDB.- Throws:
CamelMongoDbException
-
setOperation
Sets the operation this endpoint will execute against MongoDB. -
getOperation
-
setDatabase
Sets the name of the MongoDB database to target- Parameters:
database
- name of the MongoDB database
-
getDatabase
-
setCreateCollection
public void setCreateCollection(boolean createCollection) Create collection during initialisation if it doesn't exist. Default is true.- Parameters:
createCollection
- true or false
-
isCreateCollection
public boolean isCreateCollection() -
setMongoConnection
public void setMongoConnection(com.mongodb.client.MongoClient mongoConnection) Sets the Mongo instance that represents the backing connection- Parameters:
mongoConnection
- the connection to the database
-
getMongoConnection
public com.mongodb.client.MongoClient getMongoConnection() -
setDynamicity
public void setDynamicity(boolean dynamicity) Sets whether this endpoint will attempt to dynamically resolve the target database and collection from the incoming Exchange properties. Can be used to override at runtime the database and collection specified on the otherwise static endpoint URI. It is disabled by default to boost performance. Enabling it will take a minimal performance hit.- Parameters:
dynamicity
- true or false indicated whether target database and collection should be calculated dynamically based on Exchange properties.- See Also:
-
isDynamicity
public boolean isDynamicity() -
setDbConsumerType
Reserved for future use, when more consumer types are supported.- Parameters:
dbConsumerType
- key of the consumer type- Throws:
CamelMongoDbException
- if consumer type is not supported
-
getDbConsumerType
-
getConsumerType
-
setConsumerType
Consumer type. -
getTailTrackDb
-
setTailTrackDb
Indicates what database the tail tracking mechanism will persist to. If not specified, the current database will be picked by default. Dynamicity will not be taken into account even if enabled, i.e. the tail tracking database will not vary past endpoint initialisation.- Parameters:
tailTrackDb
- database name
-
getTailTrackCollection
-
setTailTrackCollection
Collection where tail tracking information will be persisted. If not specified,MongoDbTailTrackingConfig.DEFAULT_COLLECTION
will be used by default.- Parameters:
tailTrackCollection
- collection name
-
getTailTrackField
-
setTailTrackField
Field where the last tracked value will be placed. If not specified,MongoDbTailTrackingConfig.DEFAULT_FIELD
will be used by default.- Parameters:
tailTrackField
- field name
-
setPersistentTailTracking
public void setPersistentTailTracking(boolean persistentTailTracking) Enable persistent tail tracking, which is a mechanism to keep track of the last consumed message across system restarts. The next time the system is up, the endpoint will recover the cursor from the point where it last stopped slurping records.- Parameters:
persistentTailTracking
- true or false
-
isPersistentTailTracking
public boolean isPersistentTailTracking() -
setTailTrackIncreasingField
Correlation field in the incoming record which is of increasing nature and will be used to position the tailing cursor every time it is generated. The cursor will be (re)created with a query of type: tailTrackIncreasingField greater than lastValue (possibly recovered from persistent tail tracking). Can be of type Integer, Date, String, etc. NOTE: No support for dot notation at the current time, so the field should be at the top level of the document.- Parameters:
tailTrackIncreasingField
-
-
getTailTrackIncreasingField
-
getTailTrackingConfig
-
setCursorRegenerationDelay
public void setCursorRegenerationDelay(long cursorRegenerationDelay) MongoDB tailable cursors will block until new data arrives. If no new data is inserted, after some time the cursor will be automatically freed and closed by the MongoDB server. The client is expected to regenerate the cursor if needed. This value specifies the time to wait before attempting to fetch a new cursor, and if the attempt fails, how long before the next attempt is made. Default value is 1000ms.- Parameters:
cursorRegenerationDelay
- delay specified in milliseconds
-
getCursorRegenerationDelay
public long getCursorRegenerationDelay() -
setPersistentId
One tail tracking collection can host many trackers for several tailable consumers. To keep them separate, each tracker should have its own unique persistentId.- Parameters:
persistentId
- the value of the persistent ID to use for this tailable consumer
-
getPersistentId
-
isWriteResultAsHeader
public boolean isWriteResultAsHeader() -
setWriteResultAsHeader
public void setWriteResultAsHeader(boolean writeResultAsHeader) In write operations, it determines whether instead of returning WriteResult as the body of the OUT message, we transfer the IN message to the OUT and attach the WriteResult as a header.- Parameters:
writeResultAsHeader
- flag to indicate if this option is enabled
-
getOutputType
-
setOutputType
Convert the output of the producer to the selected type : DocumentList Document or MongoIterable. DocumentList or MongoIterable applies to findAll and aggregate. Document applies to all other operations.- Parameters:
outputType
-
-
getMongoDatabase
public com.mongodb.client.MongoDatabase getMongoDatabase() -
getMongoCollection
public com.mongodb.client.MongoCollection<org.bson.Document> getMongoCollection() -
getStreamFilter
-
setStreamFilter
Filter condition for change streams consumer. -
getFullDocument
public com.mongodb.client.model.changestream.FullDocument getFullDocument() -
setFullDocument
public void setFullDocument(com.mongodb.client.model.changestream.FullDocument fullDocument) Specifies whether changeStream consumer include a copy of the full document when modified by update operations. Possible values are default, updateLookup, required and whenAvailable. -
setWriteConcern
Configure the connection bean with the level of acknowledgment requested from MongoDB for write operations to a standalone mongod, replicaset or cluster. Possible values are ACKNOWLEDGED, W1, W2, W3, UNACKNOWLEDGED, JOURNALED or MAJORITY.- Parameters:
writeConcern
-
-
getWriteConcern
-
getWriteConcernBean
public com.mongodb.WriteConcern getWriteConcernBean() -
setReadPreference
Configure how MongoDB clients route read operations to the members of a replica set. Possible values are PRIMARY, PRIMARY_PREFERRED, SECONDARY, SECONDARY_PREFERRED or NEAREST- Parameters:
readPreference
-
-
getReadPreference
-
getReadPreferenceBean
public com.mongodb.ReadPreference getReadPreferenceBean() -
getUsername
-
setUsername
Username for mongodb connection- Parameters:
username
-
-
getPassword
-
setPassword
User password for mongodb connection- Parameters:
password
-
-
getHosts
-
setHosts
Host address of mongodb server in `[host]:[port]` format. It's possible also use more than one address, as comma separated list of hosts: `[host1]:[port1],[host2]:[port2]`. If the hosts parameter is specified, the provided connectionBean is ignored.- Parameters:
hosts
-
-
getAuthSource
-
setAuthSource
The database name associated with the user's credentials.- Parameters:
authSource
-
-
setServerSelectionTimeoutMS
Specifies how long (in milliseconds) to block for server selection before throwing an exception. Default: 30,000 milliseconds.- Parameters:
serverSelectionTimeoutMS
-
-
getServerSelectionTimeoutMS
-
setLocalThresholdMS
The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. Default: 15 milliseconds.- Parameters:
localThresholdMS
-
-
getLocalThresholdMS
-
setHeartbeatFrequencyMS
heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. Default: Single-threaded drivers: 60 seconds. Multi-threaded drivers: 10 seconds.- Parameters:
heartbeatFrequencyMS
-
-
getHeartbeatFrequencyMS
-
setReplicaSet
Specifies that the connection string provided includes multiple hosts. When specified, the driver attempts to find all members of that set.- Parameters:
replicaSet
-
-
getReplicaSet
-
setTls
public void setTls(boolean tls) Specifies that all communication with MongoDB instances should use TLS. Supersedes the ssl option. Default: false- Parameters:
tls
-
-
isTls
public boolean isTls() -
setTlsAllowInvalidHostnames
public void setTlsAllowInvalidHostnames(boolean tlsAllowInvalidHostnames) Specifies that the driver should allow invalid hostnames in the certificate for TLS connections. Supersedes sslInvalidHostNameAllowed. Has the same effect as tlsInsecure by setting tlsAllowInvalidHostnames to true. Default: false- Parameters:
tlsAllowInvalidHostnames
-
-
isTlsAllowInvalidHostnames
public boolean isTlsAllowInvalidHostnames() -
setConnectTimeoutMS
Specifies the maximum amount of time, in milliseconds, the Java driver waits for a connection to open before timing out. A value of 0 instructs the driver to never time out while waiting for a connection to open. Default: 10000 (10 seconds)- Parameters:
connectTimeoutMS
-
-
getConnectTimeoutMS
-
setSocketTimeoutMS
Specifies the maximum amount of time, in milliseconds, the Java driver will wait to send or receive a request before timing out. A value of 0 instructs the driver to never time out while waiting to send or receive a request. Default: 0- Parameters:
socketTimeoutMS
-
-
getSocketTimeoutMS
-
setMaxIdleTimeMS
Specifies the maximum amount of time, in milliseconds, the Java driver will allow a pooled connection to idle before closing the connection. A value of 0 indicates that there is no upper bound on how long the driver can allow a pooled collection to be idle. Default: 0- Parameters:
maxIdleTimeMS
-
-
getMaxIdleTimeMS
-
setMaxLifeTimeMS
Specifies the maximum amount of time, in milliseconds, the Java driver will continue to use a pooled connection before closing the connection. A value of 0 indicates that there is no upper bound on how long the driver can keep a pooled connection open. Default: 0- Parameters:
maxLifeTimeMS
-
-
getMaxLifeTimeMS
-
setMinPoolSize
Specifies the minimum number of connections that must exist at any moment in a single connection pool. Default: 0- Parameters:
minPoolSize
-
-
getMinPoolSize
-
setMaxPoolSize
The maximum number of connections in the connection pool. The default value is 100.- Parameters:
maxPoolSize
-
-
getMaxPoolSize
-
setMaxConnecting
Specifies the maximum number of connections a pool may be establishing concurrently. Default: 2- Parameters:
maxConnecting
-
-
getMaxConnecting
-
setWaitQueueTimeoutMS
Specifies the maximum amount of time, in milliseconds that a thread may wait for a connection to become available. Default: 120000 (120 seconds)- Parameters:
waitQueueTimeoutMS
-
-
getWaitQueueTimeoutMS
-
setReadPreferenceTags
A representation of a tag set as a comma-separated list of colon-separated key-value pairs, e.g. "dc:ny,rack:1". Spaces are stripped from beginning and end of all keys and values. To specify a list of tag sets, using multiple readPreferenceTags, e.g. readPreferenceTags=dc:ny,rack:1;readPreferenceTags=dc:ny;readPreferenceTags= Note the empty value for the last one, which means match any secondary as a last resort. Order matters when using multiple readPreferenceTags.- Parameters:
readPreferenceTags
-
-
getReadPreferenceTags
-
setMaxStalenessSeconds
Specifies, in seconds, how stale a secondary can be before the driver stops communicating with that secondary. The minimum value is either 90 seconds or the heartbeat frequency plus 10 seconds, whichever is greater. For more information, see the server documentation for the maxStalenessSeconds option. Not providing a parameter or explicitly specifying -1 indicates that there should be no staleness check for secondaries. Default: -1- Parameters:
maxStalenessSeconds
-
-
getMaxStalenessSeconds
-
setAppName
Sets the logical name of the application. The application name may be used by the client to identify the application to the server, for use in server logs, slow query logs, and profile collection. Default: null- Parameters:
appName
-
-
getAppName
-
setCompressors
Specifies one or more compression algorithms that the driver will attempt to use to compress requests sent to the connected MongoDB instance. Possible values include: zlib, snappy, and zstd. Default: null- Parameters:
compressors
-
-
getCompressors
-
setZlibCompressionLevel
Specifies the degree of compression that Zlib should use to decrease the size of requests to the connected MongoDB instance. The level can range from -1 to 9, with lower values compressing faster (but resulting in larger requests) and larger values compressing slower (but resulting in smaller requests). Default: null- Parameters:
zlibCompressionLevel
-
-
getZlibCompressionLevel
-
setSrvServiceName
Specifies the service name of the SRV resource recordsthe driver retrieves to construct your seed list. You must use the DNS Seed List Connection Format in your connection URI to use this option. Default: mongodb- Parameters:
srvServiceName
-
-
getSrvServiceName
-
setSrvMaxHosts
The maximum number of hosts from the SRV record to connect to.- Parameters:
srvMaxHosts
-
-
getSrvMaxHosts
-
setRetryWrites
public void setRetryWrites(boolean retryWrites) Specifies that the driver must retry supported write operations if they fail due to a network error. Default: true- Parameters:
retryWrites
-
-
isRetryWrites
public boolean isRetryWrites() -
setRetryReads
public void setRetryReads(boolean retryReads) Specifies that the driver must retry supported read operations if they fail due to a network error. Default: true- Parameters:
retryReads
-
-
isRetryReads
public boolean isRetryReads() -
setDirectConnection
public void setDirectConnection(boolean directConnection) Specifies that the driver must connect to the host directly. Default: false- Parameters:
directConnection
-
-
isDirectConnection
public boolean isDirectConnection() -
setLoadBalanced
public void setLoadBalanced(boolean loadBalanced) If true the driver will assume that it's connecting to MongoDB through a load balancer.- Parameters:
loadBalanced
-
-
isLoadBalanced
public boolean isLoadBalanced()
-