MongoDB

MongoDBSinkConnector: From EventMesh to MongoDB

  1. launch your MongoDB server and EventMesh Runtime.
  2. enable sinkConnector and check sink-config.yml.
  3. start your MongoDBConnectorServer, it will subscribe to the topic defined in pubSubConfig.subject of EventMesh Runtime and send data to connectorConfig.collection in your MongoDB.
  4. send a message to EventMesh with the topic defined in pubSubConfig.subject and then you will receive the message in MongoDB.
  1. pubSubConfig:
  2. # default port 10000
  3. meshAddress: your.eventmesh.server:10000
  4. subject: TopicTest
  5. idc: FT
  6. env: PRD
  7. group: mongodbSink
  8. appId: 5031
  9. userName: mongodbSinkUser
  10. passWord: mongodbPassWord
  11. connectorConfig:
  12. connectorName: mongodbSink
  13. # REPLICA_SET or STANDALONE is supported
  14. connectorType: STANDALONE
  15. # mongodb://root:root@127.0.0.1:27018,127.0.0.1:27019
  16. url: mongodb://127.0.0.1:27018
  17. database: yourDB
  18. collection: yourCol

MongoDBSourceConnector: From MongoDB to EventMesh

  1. launch your MongoDB server and EventMesh Runtime.
  2. enable sourceConnector and check source-config.yml (Basically the same as sink-config.yml)
  3. start your MongoDBSourceConnector, it will subscribe to the collection defined in connectorConfig.collection in your MongoDB and send data to pubSubConfig.subject of EventMesh Runtime.
  4. write a CloudEvent message to yourCol at yourDB in your MongoDB and then you will receive the message in EventMesh.