I have setup a kafka connect docker image that is successfully configured to use Azure event hub as the broker. I was able to verify that connect was configured correctly when I saw the new event hubs created by my connect instance. In order for my kafka connect instance to talk to Azure, I had to set its configuration with these settings:
ENV CONNECT_BOOTSTRAP_SERVERS="weavix.servicebus.windows.net:9093"
ENV CONNECT_SECURITY_PROTOCOL="SASL_SSL"
ENV CONNECT_SASL_MECHANISM="PLAIN"
ENV CONNECT_SASL_JAAS_CONFIG="<my connection string>";"
My MongoDB cluster is hosted by Mongo.
I installed mongodb/kafka-connect-mongodb:1.11.0 connector and sent this payload for a new connector:
{
{
"name": "weavix-dev-master-mongodb-source",
"config": {
"tasks.max": "1",
"connector.class": "com.mongodb.kafka.connect.MongoSourceConnector",
"connection.uri": "mongodb+srv://<user>:<password>@<my db>.mezxs.mongodb.net/test?authSource=admin&replicaSet=atlas-8mkql5-shard-0&readPreference=primary&ssl=true",
"database": "master",
"topic.prefix": "weavix-dev",
"collection": "accounts",
"topic.separator": "-",
"startup.mode": "copy_existing"
}
}
The connection string I use is usable with MongoCompass.
Unfortunately, I am getting in the logs is a repetitive set of messages:
[2023-10-09 21:09:16,558] INFO [weavix-dev-master-mongodb-source|task-0] [Producer clientId=connector-producer-weavix-dev-master-mongodb-source-0] Node -1 disconnected. (org.apache.kafka.clients.NetworkClient:937)
[2023-10-09 21:09:16,558] INFO [weavix-dev-master-mongodb-source|task-0] [Producer clientId=connector-producer-weavix-dev-master-mongodb-source-0] Cancelled in-flight API_VERSIONS request with correlation id 4112 due to node -1 being disconnected (elapsed time since creation: 52ms, elapsed time since send: 52ms, request timeout: 30000ms) (org.apache.kafka.clients.NetworkClient:341)
[2023-10-09 21:09:16,558] WARN [weavix-dev-master-mongodb-source|task-0] [Producer clientId=connector-producer-weavix-dev-master-mongodb-source-0] Bootstrap broker weavix.servicebus.windows.net:9093 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient:1065)
It looks like a networking issue with the connector but I don’t see any settings for the connector for setting up broker authentication. Anybody have any suggestions?