This documentation is for WSO2 Data Services Server 3.2.0. View the home page of the latest release.

Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

You can create datasources to expose data in MongoDB databases, as services, using the WSO2 Data Services Server. You can select MongoDB as the datasource type at the time a datasource is created. That is, the MongoDB specific options will be available as shown below.

 

The fields available for MongoDB data source type are as follows:

  • Servers: A comma separated list of server hosts and ports where the database is running. E.g.: "localhost" - "125.10.5.3, 125.10.5.4" - "192.168.3.1:27017, 192.168.3.2:27017"
  • Database Name:  The name of the database to which you want to connect.
  • Write Concern: The write concern value to control the write behaviour for with the following options, as well as exception raising on error conditions.

    OptionDescription
    FSYNC_SAFEExceptions are raised for network issues, and server errors. The write operation waits for the server to flush the data to disk.
    NONENo exceptions are raised, even for network issues.
    NORMALExceptions are raised for network issues, but not server errors.
    REPLICAS_SAFEExceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
    SAFEExceptions are raised for network issues, and server errors; waits on a server for the write operation.
  • Read Preference: The read preference value which describes how MongoDB clients route read operations to members of a replica set. It has the following options.

    OptionDescription
    PRIMARYDefault mode. All operations read from the current replica set primary.
    SECONDARYAll operations read from the secondary members of the replica set.
  • Auto Connect Retry: To control whether or not to connect, the system retries automatically.
  • Connection Timeout: Connect timeout in milliseconds. 0 is default and infinite.
  • Max. Wait: Max wait time of a blocking thread for a connection.
  • Socket Timeout: Socket timeout value. 0 is default and infinite.
  • Connections per Host: Number of connections allowed per host will block if run out.
  • Threads Allowed to Block For Connection Multiplier: Multiplier for connectionsPerHost for # of threads that can block if connectionsPerHost is 10, and threadsAllowedToBlockForConnectionMultiplier is 5, then 50 threads can block more than that and an exception will be throw.

To write a query to this datasource, see Writing Data Service Queries.

  • No labels