Skip to main content
版本:v2.0.0

MongoDB connector

Audience: operators bridging EventMesh with MongoDB. MongoDB bridge. Source tails a collection's insert stream; sink inserts each CloudEvent as a document.


Classes

DirectionClassBehavior
Sourceorg.apache.eventmesh.connector.mongodb.source.MongodbSourceConnectorWatches the collection (watch() cursor) and buffers change documents for poll().
Sinkorg.apache.eventmesh.connector.mongodb.sink.MongodbSinkConnectorInserts a document per CloudEvent (_id = event id, data = payload).

Source configuration

KeyDefaultDescription
connector.mongoUrimongodb://localhost:27017MongoDB connection URI
connector.databasetestDatabase
connector.collectioneventsCollection to watch

Sink configuration

KeyDefaultDescription
connector.mongoUrimongodb://localhost:27017MongoDB connection URI
connector.databasetestDatabase
connector.collectionsinkTarget collection

Running

bin/start-connector.sh with -Dconnector.class=...MongodbSourceConnector -Dconnector.mode=source -Dconnector.mongoUri=mongodb://mongo:27017 -Dconnector.database=events