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
Apache License 2.0
153 stars 60 forks source link

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

Closed minormadrigal closed 5 years ago

minormadrigal commented 5 years ago

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

hpgrahsl commented 5 years ago

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.

minormadrigal commented 5 years ago

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

hpgrahsl commented 5 years ago

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

minormadrigal commented 5 years ago

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".