Class MongoDBSource<T>

  • Type Parameters:
    T - the output type of the source.
    All Implemented Interfaces:
    Serializable, org.apache.flink.api.connector.source.Source<T,​SourceSplitBase,​PendingSplitsState>, org.apache.flink.api.connector.source.SourceReaderFactory<T,​SourceSplitBase>, org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>

    @Internal
    @Experimental
    public class MongoDBSource<T>
    extends IncrementalSource<T,​MongoDBSourceConfig>
    The MongoDB CDC Source based on FLIP-27 which supports parallel reading snapshot of collection and then continue to capture data change from change stream.
         1. The source supports parallel capturing database(s) or collection(s) change.
         2. The source supports checkpoint in split level when read snapshot data.
         3. The source doesn't need apply any lock of MongoDB.
     
    
     MongoDBSource
         .<String>builder()
         .hosts("localhost:27017")
         .databaseList("mydb")
         .collectionList("mydb.users")
         .username(username)
         .password(password)
         .deserializer(new JsonDebeziumDeserializationSchema())
         .build();
     

    See MongoDBSourceBuilder for more details.

    See Also:
    Serialized Form