Deprecated in favor of RADAR-base/MongoDB-Sink-Connector.
Implements the hot-storage support for RADAR-CNS platform using MongoDBSinkConnector
-
In addition to Zookeeper, Kafka-broker(s), Schema-registry and Rest-proxy, MongoDB should be running with required credentials
-
Load the
radar-mongodb-sink-connector-*.jar
to CLASSPATHexport CLASSPATH=/path/to/radar-mongodb-sink-connector-0.1.jar
-
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
-
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
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.