Hi 秦寒,

Dian 说得很完善了。除此之外,金竹的博客[1]有介绍“Python API 中如何使用 Kafka”,可能对你有帮助,可以看下。

Best, Hequn

[1]
https://enjoyment.cool/2019/08/28/Apache%20Flink%20%E8%AF%B4%E9%81%93%E7%B3%BB%E5%88%97-%20Python%20API%20%E4%B8%AD%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Kafka/

On Thu, Apr 9, 2020 at 9:34 AM Dian Fu <[email protected]> wrote:

> 你指的是Python Table API中如何使用kafka connector的例子吗?这个是有例子的[1]。
>
> 关于如何把kafka client的jar包配置到Python环境,分两种情况,当前有对应的两种解决方案:
> 1)如果是local运行,需要把kafka client的jar拷贝到python环境中pyflink的lib目录下
> 2)如果是remote运行,可以通过CLI的-j选项添加。
>
>
> 这两种方式对于Python用户来说可能都不太便捷,所以已有一个JIRA[3]在考虑添加另外一种对Python用户来说更友好的方式,欢迎到JIRA里参与讨论。
>
> [1]
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/connect.html#kafka-connector
> <
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/connect.html#kafka-connector
> >
> [2]
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/ops/cli.html
> <https://ci.apache.org/projects/flink/flink-docs-release-1.10/ops/cli.html
> >
> [3] https://issues.apache.org/jira/browse/FLINK-16943 <
> https://issues.apache.org/jira/browse/FLINK-16943>
> > 在 2020年4月9日,上午8:45,zhisheng <[email protected]> 写道:
> >
> > hi, 秦寒
> >
> > 暂时还没有 Python 这块的 API,可以去社区 JIRA 提建议
> >
> > Best
> >
> > zhisheng
> >
> > 秦寒 <[email protected]> 于2020年4月8日周三 下午4:10写道:
> >
> >> 您好
> >>
> >>       Flink的 kafka connector 文档中只有java 和scala的列子,能否添加python
> >> 调用kafka的列子,包括如何添加kafka connector,kafka client的jar包配置到pyhon
> >> 环境等,谢谢。
> >>
> >>
> >>
> >>
>
>

回复