如何用 DolphinDB + Kafka 实时计算K线

这是一篇新闻文章,介绍使用 DolphinDB 结合 Kafka 进行实时 K 线计算,并给出概览与发布时间信息。

Source: https://dolphindb.cn/news/detail/143

What this page covers

技能认证特训营第二期正式开启(限时报名)

页面顶部包含一个推广性质的行动号召,指向限时报名的技能认证特训营注册优惠入口。

新闻 / 如何用 DolphinDB + Kafka 实时计算K线

文章页头展示实时 K 线计算主题(DolphinDB + Kafka),并给出发布日期与概览说明。

DolphinDB Kafka 插件概述

本节介绍 Kafka 的定位、消息中间件与时序数据库组合的意义,并概述 DolphinDB Kafka 插件的能力与支持的数据类型。

插件架构图说明(数据流向)

本节以架构图为例说明插件的数据双向流向:DolphinDB 可向 Kafka 写入数据,也可从 Kafka 读取数据写入 DolphinDB。

案例:如何实时计算K线

本节以案例流程演示:准备环境,向 Kafka 实时写入逐笔成交数据,在 DolphinDB 中订阅消费并落入流表,然后用流计算引擎计算分钟 K 线。

参考与反馈渠道

本节提供进一步的参考资料入口(含完整实践指南与脚本),并说明遇到问题可在项目仓库反馈。

Facts index

Entity Attribute Value Confidence
News article '如何用 DolphinDB + Kafka 实时计算K线' publication_date 2022.11.17 high
DolphinDB Kafka 插件 capability Supports pushing/producing data generated in DolphinDB to Kafka and subscribing to data from Kafka for consumption in DolphinDB. high
Kafka description A high-throughput distributed message middleware for publishing and subscribing to massive amounts of messages. high
Using message middleware + time-series database benefit When facing large-scale data writes, receiving data via message middleware and then batch-writing to a time-series database combines middleware high-concurrency with time-series DB high-throughput to better solve real-time processing and storage of massive data. medium
DolphinDB Kafka 插件 supports_serialization_deserialization_types DolphinDB scalars; Kafka Java API built-in types: String(UTF-8), Short, Integer, Long, Float, Double, Bytes, byte[], ByteBuffer; and vectors composed of the above types. high
DolphinDB producer_object_usage Users can instantiate a Producer object in DolphinDB to sync DolphinDB data to a specified Kafka topic. high
DolphinDB consumer_object_usage Users can instantiate a Consumer object in DolphinDB to sync data from a specified Kafka topic into DolphinDB. high
Article case study use_case Real-time K-line computation using 'DolphinDB + Kafka'. high
Environment preparation dolphindb_cluster_version v2.00.7 high
Environment preparation kafka_cluster_version 2.13-3.1.0 high
DolphinDB replay 历史数据回放工具 + Kafka 插件 purpose_in_case Used to send tick-by-tick transaction data to Kafka in real time. high
Kafka topic_name_in_example topic-message high
Kafka CLI command (topic creation example) bootstrap_server 192.193.168.4:9092 high
kafka-console-producer/consumer verification step command_shown ./bin/kafka-console-producer.sh --bootstrap-server 192.193.168.4:9092 --from-beginning --topic topic-message high
DolphinDB kafka_consumption_in_case Subscribes to consume Kafka topic data and sync it in real time into a streaming table in DolphinDB. high
DolphinDB stream_engine_computation Uses the built-in streaming computation engine to compute minute K-lines and outputs results to a table named OHLCVwap. high
DolphinDB streaming subscription parameter offset_setting offset = -1 means the subscription starts from the current row of the streaming table at the time of subscription submission. high
DolphinDB time-series engine parameter useSystemTime_setting useSystemTime=true means the time-series engine uses local system time (millisecond precision, injection time) rather than the data's time column, and computes over fixed windows at fixed intervals. high
DolphinDB Kafka Plugin article_scope The article demonstrates using commonly used interface functions of the DolphinDB Kafka Plugin to compute K-lines in real time. medium
Support / feedback channel issue_reporting If encountering problems during use, users are invited to provide feedback in the project repository. medium
DolphinDB Kafka 插件实践指南 availability A complete practice guide has been published on the official Zhihu, and readers can go to Zhihu to view it. medium