英文:
Fetching data from DB via Kafka Connectors
问题
在Mongo DB上通过Kafka连接器按需查询数据是否可行?
例如,假设我有一组汽车数据如下 -
{
Brand: Mahindra,
Model: XUV300
}
{
Brand: Mahindra,
Model: XUV500
}
{
Brand: TATA,
Model: Nexon
}
我想通过Kafka连接器获取所有Mahindra的车型。
我应该怎么做才能查询并将这些数据放入我的一个Kafka主题中?
目标是通过Kafka来控制一切,而不是直接通过代码与数据库交互。
尝试查阅Kafka文档和Google,但没有找到任何解决方案。
英文:
Is it’s possible to query data on demand from a DB (e.g. Mongo DB) via Kafka connectors?
i.e. let’s say I have a collection of cars with the following data –
{
Brand: Mahindra,
Model: XUV300
}
{
Brand: Mahindra,
Model: XUV500
}
{
Brand: TATA,
Model: Nexon
}
I want to fetch all Mahindra Models via Kafka connector.
What should I do so I can query and get this data in one of my Kafka topics?
The aim is to control everything via Kafka and not to interact directly with db via code.
Tried going through Kafka doc and Google but didn't find any solutions
答案1
得分: 1
以下是翻译好的内容:
有些连接器确实允许自定义筛选查询,比如 JDBC 源。
否则,您可以尝试使用带有谓词的 Filter SMT 来筛选记录中的数据。
链接地址:https://docs.confluent.io/platform/current/connect/transforms/filter-confluent.html
英文:
Some connectors do allow custom filters queries, such as the JDBC source.
Otherwise, you can try to use the Filter SMT with a predicate to filter data that's part of the record
https://docs.confluent.io/platform/current/connect/transforms/filter-confluent.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论