简体   繁体   English

使用 spring apache kafka 从 kafka topic 加载数据到 Cassandra

[英]Loading Data to Cassandra from kafka topic using spring apache kafka

I'm trying to develop an spring application which will take input from user and store it to topic and then I wan't to load it to cassandra from this topic (Note:- not using confluent kafka version).我正在尝试开发一个 spring 应用程序,该应用程序将从用户那里获取输入并将其存储到主题,然后我不想从该主题将其加载到 cassandra(注意:- 不使用 confluent kafka 版本)。 SO, far I was able to write a producer and consumer logic in spring and now need to load data from kafka topic to cassandra. How can I do this???所以,到目前为止,我能够在 spring 中编写生产者和消费者逻辑,现在需要将数据从 kafka 主题加载到 cassandra。我该怎么做??? When I look over inte.net it was suggested to go with API provided by confluent kafka.当我查看 inte.net 时,建议使用 go 和 API 由 confluent kafka 提供。 But, I would like to do it in Spring. I'm not sure how to code and not sure if I can achieve this with non confluent flavour of apache kafka.但是,我想在 Spring 中进行。我不确定如何编码,也不确定我是否可以使用 apache kafka 的非融合风格来实现这一点。

Thanks in advance提前致谢

If the data is already published on a Kafka topic, you can just use the DataStax Kafka connector for Apache Cassandra, DataStax Enterprise and Astra DB .如果数据已经发布在 Kafka 主题上,您可以只使用 DataStax Kafka 连接器Apache Cassandra、DataStax Enterprise 和Astra DB

The connector lets you save records from a Kafka topic to Cassandra tables.连接器允许您将记录从 Kafka 主题保存到 Cassandra 表。 It is open-source so it's free to use.它是开源的,因此可以免费使用。 Cheers!干杯!

Spring Data has a Cassandra Module: Spring 数据有一个 Cassandra 模块:

https://spring.io/projects/spring-data-cassandra https://spring.io/projects/spring-data-cassandra

The Apache Cassandra NoSQL Database offers many new capabilities for teams seeking a solution to handle high velocity, high volume and variable data flows. Apache Cassandra NoSQL 数据库为寻求处理高速、大容量和可变数据流的解决方案的团队提供了许多新功能。 This new way of thinking introduces new concepts and a learning curve that can be intimidating to team members and team managers.这种新的思维方式引入了新的概念和学习曲线,这可能会让团队成员和团队经理望而生畏。 Spring Data for Apache Cassandra offers a familiar interface to those who have used other Spring Data modules in the past. Spring Apache 的数据 Cassandra 为过去使用过其他 Spring 数据模块的用户提供了熟悉的界面。

The learning curve for developing applications with Apache Cassandra is significantly reduced when using Spring Data for Apache Cassandra. With the power to stay at a high level with annotated POJOs, or at a low level with high performance data ingestion capabilities, the Spring Data for Apache Cassandra templates are sure to meet every application need. The learning curve for developing applications with Apache Cassandra is significantly reduced when using Spring Data for Apache Cassandra. With the power to stay at a high level with annotated POJOs, or at a low level with high performance data ingestion capabilities, the Spring Data for Apache Cassandra 模板一定能满足各种应用需求。

Features Build repositories based on common Spring Data interfaces特性 基于通用 Spring 数据接口构建存储库

  • Support for synchronous, reactive, and asynchronous data operations支持同步、反应和异步数据操作

  • Support for XML based Keyspace creation and CQL Table creation支持基于 XML 的 Keyspace 创建和 CQL Table 创建

  • JavaConfig and XML Support for all Cluster and Session Capabilities JavaConfig 和 XML 支持所有集群和 Session 功能

  • Exception Translation to the familiar Spring DataAccessException hierarchy异常转换为熟悉的 Spring DataAccessException 层次结构

  • Convenient QueryBuilders to eliminate the need to learn CQL方便的 QueryBuilder 无需学习 CQL

  • Automatic implementation of Repository interfaces including support for custom query methods自动实现 Repository 接口,包括支持自定义查询方法

  • 2.x versions are based on the 3.x DataStax CQL Java Driver, 3.x versions use DataStax Java Driver 4.x 2.x版本基于3.x DataStax CQL Java Driver,3.x版本使用DataStax Java Driver 4.x

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

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