![](https://img-blog.csdnimg.cn/20190918140129601.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
kafka
文章平均质量分 87
# kafka
执于代码
职业画像详情:https://github.com/xiamaocheng,
其他:https://www.infoq.cn/profile/8E8D58FE040264/publish
展开
-
kafka 和flume对接
Kafka Sink 提供了可靠的方式将数据写入 Kafka,支持批量写入、分区和副本的配置,确保数据的可靠性和一致性。保证数据的顺序性:可以使用 Kafka 的分区机制来控制数据的顺序,确保相同 key 的数据被写入到同一个 partition 中,保证数据的顺序性。Kafka Sink 会负责将数据写入指定的 topic,根据配置的 partition 和副本策略,将数据分布到 Kafka 集群中的不同节点上。您需要提供目标的相关配置,如HDFS的文件路径、HBase的表名称等。原创 2024-05-28 09:37:18 · 1061 阅读 · 0 评论 -
kafka API 自定义拦截器
Kafka API 自定义拦截器在 Kafka 中,拦截器是一种机制,可以通过在消息发送和消费的过程中添加自定义的逻辑。拦截器可以用于各种用途,例如日志记录、监视、数据转换等。要实现自定义拦截器,需要创建一个类,实现 Kafka 的或接口,具体取决于你是要在消息发送还是消息消费时使用拦截器。// 在消息消费之前运行的逻辑 // 在这里可以对消息进行处理或记录日志 for(ConsumerRecord < String , String > record : records) {原创 2024-05-27 23:10:48 · 875 阅读 · 0 评论 -
kafka 案例
System . out . println("消息发送成功!");} else {System . out . println("消息发送失败:" + exception . getMessage());} } });} }System . out . println("消息发送成功!");} else {System . out . println("消息发送失败:" + exception . getMessage());} } });} }原创 2024-05-26 14:31:37 · 704 阅读 · 0 评论 -
消费者相关&高效读写&ZK作用
1.消费者分区分配策略2. 消费者offset的存储3. 消费者组案例4. 高效读写&Zk作用5. Ranger分区再分析。原创 2024-05-26 14:13:01 · 1098 阅读 · 0 评论 -
kafka生产者相关
kafka生产者相关:在 Kafka 中,生产者的分区策略可以通过配置参数 来指定。当生产者发送消息到主题时,分区策略决定了消息被分配到哪个分区中。Kafka 提供了以下几种默认的分区策略:除了默认的分区策略之外,Kafka 还允许用户自定义分区策略。用户可以实现 接口,并通过配置参数 指定自定义的分区策略。自定义的分区策略可以根据业务需求来选择分区的方式,比如根据消息的某个字段来选择分区,或者根据一些特定的规则来选择分区。自定义分区策略可以提高消息的分布均衡性,从而提高整体的性能和可扩展性。Kafk原创 2024-05-25 18:53:00 · 1064 阅读 · 0 评论 -
kafka 工作流程&文件存储
kafka 工作流程&文件存储。原创 2024-05-25 18:38:58 · 687 阅读 · 0 评论 -
kafka 消费模式&基础架构
kafka消费模式。原创 2024-05-25 17:56:11 · 1253 阅读 · 0 评论 -
Kafka高级_生产者ACk机制&数据一致性问题
每个分区都有多个副本,其中一个被选为领导者,负责处理所有的读写请求,其余副本作为追随者,只负责与领导者进行数据同步。因此,在领导者写入数据之后,追随者可能还没有完全同步,这导致了部分数据一致性的问题。当追随者与领导者之间的复制延迟过高时,追随者将被自动踢出ISR,这样可以避免延迟过高的副本对数据一致性造成影响。这样可以减少延迟,提高吞吐量,但也会导致数据在多个副本之间存在一定的延迟,从而可能出现数据不一致的情况。通过增加ISR中的副本数量,可以提高数据的容错性和可用性,但也会增加复制延迟。原创 2024-01-29 22:07:10 · 1065 阅读 · 0 评论 -
Kafka高级_生产者分区策略&生产者ISR
默认分区策略:在没有指定分区策略时,生产者会使用默认的分区策略。默认分区策略是根据消息的键值进行哈希计算,然后将消息分配到对应的分区中。自定义分区策略:如果默认的分区策略无法满足需求,可以自定义分区策略。自定义分区策略需要实现org.apache.kafka.clients.producer.Partitioner接口,并重写partition方法。通过自定义分区策略,可以根据自己的业务逻辑来决定消息分配到哪个分区中。轮询分区策略:轮询分区策略会按照轮询的方式,依次将消息分配到每个分区中。原创 2024-01-29 21:29:54 · 971 阅读 · 0 评论 -
Kafka高级_工作流程&文件存储
Kafka的工作流程如下:Producer:消息生产者将消息发送到Kafka集群。Producer可以将消息发送到指定的Topic,也可以将消息发送到多个Topic。Producer也可以指定消息的分区方式和消息的顺序。Broker:Kafka集群由多个Broker组成,每个Broker是一个独立的Kafka服务器。每个Broker负责管理一部分Topic的分区副本。Broker接收来自Producer的消息,并将其存储在磁盘上,以便后续的消费者能够消费。原创 2024-01-27 12:51:02 · 960 阅读 · 0 评论 -
Kafka 常见面试题
Kafka 常见面试题at-most-once:至多一次【允许为0次,可能数据丢失】at-least-once:至少一次【至少一次,允许多次,可能数据重复】exactly-once:有且仅有一次【只有一次,精准数据传输】转载 2023-03-11 13:27:25 · 121 阅读 · 0 评论 -
kafka 问题
分布式消息是一种通信机制,和 RPC、HTTP、RMI 等不一样,消息中间件采用分布式中间代理的方式进行通信。如图所示,采用了消息中间件之后,上游业务系统发送消息,先存储在消息中间件,然后由消息中间件将消息分发到对应的业务模块应用(分布式生产者 - 消费者模式)。这种异步的方式,减少了服务之间的耦合程度。利用高效可靠的消息传递机制进行平台无关的数据交流基于数据通信,来进行分布式系统的集成通过提供消息传递和消息排队模型,可以在分布式环境下扩展进程间的通信。转载 2023-03-10 22:55:32 · 66 阅读 · 0 评论 -
kafka 面试题
kafka 面试题。转载 2023-03-06 18:06:59 · 60 阅读 · 0 评论 -
kafka 面试题
kafka 面试题。转载 2023-03-04 22:45:50 · 80 阅读 · 0 评论 -
Saas平台级架构:统一身份认证管理系统用户权限管理
统一身份认证管理系统权限管理。转载 2023-03-02 11:09:00 · 3449 阅读 · 0 评论 -
0302Java 面试
自我介绍: 这里是普通了一下最具有代表性的技术能力说一下:大概按照JSYH的项目逻辑说了一下,问我从架构方面说是什么意思?后来提了一个账户模型的问题,我问题为什么,面试官没有回答本人的问题说了不需要,记住不要怀疑面试官的实力。原创 2023-03-02 09:49:30 · 69 阅读 · 0 评论 -
Kafka 延迟队列
kafka 延迟队列。翻译 2023-03-02 08:38:04 · 739 阅读 · 0 评论 -
spring boot-kafka 整合
1.yam 配置文件:server: port: 8080spring: kafka: bootstrap-servers: 192.168.0.60:9092,192.168.0.60:9093,192.168.0.60:9094 producer: # 生产者 retries: 3 # 设置大于0的值,则客户端会将发送失败的记录重新发送 ...原创 2020-02-03 09:39:11 · 271 阅读 · 0 评论 -
kafk的使用场景和集群入门
kafk的使用场景和集群入门目录概述此外:小结:参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk is c原创 2022-05-29 18:07:19 · 254 阅读 · 0 评论 -
kafka 架构分析
kafka消息队列的方式目录概述小结:参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk is cheap,原创 2022-01-19 19:14:58 · 3249 阅读 · 0 评论 -
【无标题】
kafka消息队列的方式目录概述小结:参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk is cheap,原创 2022-01-17 21:22:52 · 57 阅读 · 0 评论 -
kafka消息队列的方式
kafka消息队列的方式目录概述小结:参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk is cheap,原创 2022-01-17 21:12:25 · 1621 阅读 · 0 评论 -
Kafka高可用&伸缩部署详解
kafka原创 2021-12-05 21:41:09 · 330 阅读 · 0 评论 -
分区管理,优先副本选举机制
kafka--- consumer 消费消息目录概 述小结参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk原创 2021-11-29 23:48:46 · 401 阅读 · 0 评论 -
2 协调器
kafka--- consumer 消费消息目录概 述小结参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk原创 2021-11-29 23:37:12 · 319 阅读 · 0 评论 -
消费者rebalance机制分析
kafka--- consumer 消费消息目录概 述小结参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk原创 2021-11-29 23:25:28 · 182 阅读 · 0 评论 -
KafkaConsumer中的位移提交
kafka--- consumer 消费消息目录概 述小结参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk原创 2021-11-29 23:10:42 · 303 阅读 · 0 评论 -
Kafka Consumer底层原理分析【Kafka系列】
微服务相关工具目录概 述小结参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.talk is cheap, show原创 2021-11-29 22:01:20 · 217 阅读 · 0 评论 -
Kafka序列化器,分区器,拦截器,消息累加器
Kafka序列化器,分区器,拦截器,消息累加器目录概 述小结参考资料和推荐阅读LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.tal原创 2021-11-29 21:41:44 · 233 阅读 · 0 评论 -
kafka 安装入门:
kafka入门:一。安装JDK二。安装zk参见:三。安装kafka:启动:/usr/local/zookeeper-3.4.13/bin/zkServer.sh start启动:bin/kafka-server-start.sh config/server.properties3.1 解压3.1 启动ZooKeeper:3.2 停止kafkabin/kafka-server-stop.sh config/server.properties4.1 创建to..原创 2020-11-01 17:55:58 · 261 阅读 · 0 评论