MongoDB
MongoDBSinkConnector: From EventMesh to MongoDB
- launch your MongoDB server and EventMesh Runtime.
- enable sinkConnector and check
sink-config.yml
. - start your MongoDBConnectorServer, it will subscribe to the topic defined in
pubSubConfig.subject
of EventMesh Runtime and send data toconnectorConfig.collection
in your MongoDB. - send a message to EventMesh with the topic defined in
pubSubConfig.subject
and then you will receive the message in MongoDB.
pubSubConfig:
# default port 10000
meshAddress: your.eventmesh.server:10000
subject: TopicTest
idc: FT
env: PRD
group: mongodbSink
appId: 5031
userName: mongodbSinkUser
passWord: mongodbPassWord
connectorConfig:
connectorName: mongodbSink
# REPLICA_SET or STANDALONE is supported
connectorType: STANDALONE
# mongodb://root:root@127.0.0.1:27018,127.0.0.1:27019
url: mongodb://127.0.0.1:27018
database: yourDB
collection: yourCol
MongoDBSourceConnector: From MongoDB to EventMesh
- launch your MongoDB server and EventMesh Runtime.
- enable sourceConnector and check
source-config.yml
(Basically the same assink-config.yml
) - start your
MongoDBSourceConnector
, it will subscribe to the collection defined inconnectorConfig.collection
in your MongoDB and send data topubSubConfig.subject
of EventMesh Runtime. - write a CloudEvent message to
yourCol
atyourDB
in your MongoDB and then you will receive the message in EventMesh.