简体   繁体   English

如何将本地 Kafka 集群连接到本地 Mongodb?

[英]How do I connect Local Kafka Cluster to Local Mongodb?

I am currently working on a small project where I need to connect a kafka cluster to mongodb so that the mesages published to kafka topic gets stored in the mongodb database.我目前正在做一个小项目,我需要将一个 kafka 集群连接到 mongodb 以便发布到 kafka 主题的消息存储在 mongodb 数据库中。 I currently have a local kafka cluster, a springboot producer publishing messages to a topic and a springboot consumer consuming those messages locally.我目前有一个本地 kafka 集群、一个向主题发布消息的 springboot 生产者和一个在本地消费这些消息的 springboot 消费者。 I also have installed mongodb compass locally...i have been looking at tutorials and what i have figured out is that i have to use some kind of sink connector(mongodb connector) for what i want to do but most of the examples are based on mongodb atlas and confluent or aws managed kafka...is there any good tutorials i can follow to learn how to do on local kafka cluster and local mongodb or if any one of u can explain me what to do, i will greatly appreciate it.. Thanks.我还在本地安装了 mongodb 指南针......我一直在看教程,我发现我必须使用某种接收器连接器(mongodb 连接器)来做我想做的事情,但大多数示例都是基于在 mongodb atlas 和 confluent 或 aws 管理的 kafka 上...有什么好的教程我可以学习如何在本地 kafka 集群和本地 mongodb 上做,或者如果你们中的任何一个可以解释我该怎么做,我将不胜感激.. 谢谢。

most of the examples are based on mongodb atlas and confluent or aws managed kafka..大多数示例基于 mongodb 地图集和融合或 aws 管理的 kafka ..

Remove any access keys or authentication, and simply modify the bootstrap.servers property + Mongo connection string, and any tutorial you find should work with your local installations删除任何访问密钥或身份验证,只需修改bootstrap.servers属性 + Mongo 连接字符串,您找到的任何教程都应该适用于您的本地安装

AFAICT, the Docker example in the documentation does not use any cloud services AFAICT,文档中的 Docker 示例未使用任何云服务

https://docs.mongodb.com/kafka-connector/current/kafka-docker-example/ https://docs.mongodb.com/kafka-connector/current/kafka-docker-example/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM