tree: ff5fd183f97510b2e32e24ec5839aba6cb27c255 [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
rocketmq-connect-mongo/README.md

RocketMQ-connect-mongo

this is source connector moudle for mongo,you can run this by running rocketmq connecotr api,

some junit rely on mongo database you can flow step run a mongo container

  • docker run -p27027:27017 --name mongo-test -d mongo:4.0.10 --replSet "repl1"
  • docker exec -it mongo-test mongo
  • rs.initiate()

init a mongo replicaSet run all junit test

a special junit

method MongoFactoryTest#testSSLTrustStore is for mongo ssl or tsl test,need mongod config ssl mode, if you want use ssl or tsl you need modify junit , appoint ssl or tsl pem path and password。

task config params

paramDescriptiontype
mongoAddrshardName=replicaSetName/127.0.0.1:2781,127.0.0.1:2782,127.0.0.1:2783;string, split by ;
mongoUserNamemongo root usernamestring
mongoPassWordmongo root passwordstring
interestDbAndCollection{“dbName”:[“collection1”,“collection2”]}, collectionName can be “*” means all collectionjson
positionTimeStampmongo oplog bsontimestamp.value, runtime store position is highest levelint
positionIncmongo oplog bsontimestamp.inc, runtime store position is highest levelint
dataSyncsync all interestDbAndCollection data, runtime store position is highest leveljson, Map<String(dbName), List<String(collectionName)>>
serverSelectionTimeoutMSmongo driver select replicaServer timeoutlong
connectTimeoutMSmongo driver connect socket timeoutlong
socketTimeoutMSmongo driver read or write timeoutlong
ssl or tslmongo driver use ssl or tslboolean
tlsInsecure or sslInvalidHostNameAllowedmongo driver when use ssl or tsl allow invalid hostnameboolean
compressorscompressors waystring (zlib or snappy)
zlibCompressionLevelzlib compressors levelint (1-7)
trustStoressl pempath
trustStorePasswordssl pem decrypt passwordstring

use case

http://127.0.0.1:8081/connectors/testMongoReplicaSet?config={"connector-class":"org.apache.connect.mongo.connector.MongoSourceConnector","oms-driver-url":"oms:rocketmq://localhost:9876/default:default","mongoAddr":"rep1/127.0.0.1:27077,127.0.0.1:27078,127.0.0.1:27080","source-record-converter":"org.apache.rocketmq.connect.runtime.converter.JsonConverter"}