Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

MongoDbConnector for RADAR-CNS platform

License

Notifications You must be signed in to change notification settings

RADAR-base/RADAR-MongoDB-Sink-Connector

Repository files navigation

RADAR-MongoDB-Sink-Connector

Deprecated in favor of RADAR-base/MongoDB-Sink-Connector.

Build Status Codacy Badge

Implements the hot-storage support for RADAR-CNS platform using MongoDBSinkConnector

To Run Radar-MongoDB-Connector

  1. In addition to Zookeeper, Kafka-broker(s), Schema-registry and Rest-proxy, MongoDB should be running with required credentials

  2. Load the radar-mongodb-sink-connector-*.jar to CLASSPATH

    export CLASSPATH=/path/to/radar-mongodb-sink-connector-0.1.jar
  3. Configure MongoDB Connector properties.

    # Kafka consumer configuration
    name=radar-connector-mongodb-sink
    
    # Kafka connector configuration
    connector.class=org.radarcns.mongodb.MongoDbSinkConnector
    tasks.max=1
    
    # Topics that will be consumed
    topics=topics
    
    # MongoDB server
    mongo.host=localhost
    mongo.port=27017
    
    # MongoDB configuration
    mongo.username=
    mongo.password=
    mongo.database=
    
    # Collection name for putting data into the MongoDB database. The {$topic} token will be replaced
    # by the Kafka topic name.
    #mongo.collection.format={$topic}
    
    # Factory class to do the actual record conversion
    record.converter.class=org.radarcns.sink.mongodb.RecordConverterFactoryRadar

    For more details visit our MongoDBConnector and Kafka-Connect

  4. Run the connector. To run the connector in standalone mode (on an enviornment where the Confluent platform is installed):

    connect-standalone /etc/schema-registry/connect-avro-standalone.properties path-to-your-mongodb-connector.properties

Contributing

New converters

  • should implement the interface org.radarcns.serialization.RecordConverte
  • should be located under the org.radarcns.sink.mongodb.converter package
  • should be listed in org.radarcns.sink.mongodb.RecordConverterFactoryRadar to be added to the class path

The converters should take advantages of org.bson.codecs.Encoder<T>. Instances of this class are capable of encoding an instance of the type parameter T into a BSON value. The counter part is org.bson.codecs.Decoder<T>

Code should be formatted using the Google Java Code Style Guide. If you want to contribute a feature or fix browse our issues, and please make a pull request.