hpgrahsl / kafka-connect-mongodb

**Unofficial / Community** Kafka Connect MongoDB Sink Connector -> integrated 2019 into the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to define a mongo cluster as the mongo host in kafka-connect-mongodb:1.3.1

minormadrigal opened this issue · comments

Hello everyone,

this is a question more than an issue. I am trying to figure out if it possible to declare a mongo cluster instead of a single host, right now we are using a custom class for this and we declare the cluster something like this:

"db.cluster": "mongo1:27017,mongo2:27017,mongo3:27017",

My question is, is there an option to do something like this natively with the sink connector in order to avoid the creation of the custom class.

thanks in advance

yes of course you can specify this by means of the connection URI settings. please read the official MongoDB docs for that which you can find here https://docs.mongodb.com/manual/reference/connection-string/#standard-connection-string-format
there is also an example for a replicaset or sharded cluster URI in the same section.

perfect, yes it works!! thank you very much!!

glad to hear it works. as always I'd be happy to learn about your use case. if you wanna share how you are leveraging the connector I'd be happy to highlight it in the README section. just let me know.
also I want to bring to your attention that there is an officially supported connector by MongoDB which was announced in June. you can find the repo here. migration from this sink to the official should be straight-forward and is also documented. take a look here https://github.com/mongodb/mongo-kafka

oh I see, thank you very much mr @hpgrahsl !!!. I will take a look, because I am having some problems with the "mongodb.field.renamer.mapping".