Skip to content

Latest commit

 

History

History
94 lines (48 loc) · 2.29 KB

File metadata and controls

94 lines (48 loc) · 2.29 KB

ElasticSearch Consumer & Consumer configurations

ElasticSearch on Demand

https://bonsai.io


Twitter data producer:

Github source code for twitter producer

ElasticSearch Consumer:

ElasticSearch consumer code


Delivery Semantics

At Most Once

deilvery_semantic_at_most_once.png

delivery_semantics_1.gif

At Least Once

deilvery_semantic_at_least_once.png

Summary

delivery_semantics_summary.png


Idempotence

To achieve Idempotence in Kafka, we can use the following to generate the same id for the same message when it is processed again. This is Kafka generic id. Similarly other methods can be used so that even if process the message more than once we don't create duplicates.

// kafka generic ID
String id = record.topic() + "_" + record.partition() + "_" + record.offset();

Consumer Offset Commits Strategies

offset_commit_strategy_1.png


enable.auto.commit = true

offset_commit_strategy_2.png


enable.auto.commit = false

offset_commit_strategy_2.png


Consumer Offset Reset Behaviour

consumer-offset-reset-behaviour-1.png

consumer-offset-reset-behaviour-2.png


Replaying data for consumers

replay-data-for-consumer.png

offset_reset.png


Controlling Consumer Liveliness

consumer-liveliness.png

Consumer Heartbeat Thread

Consumer-Heartbeat-Thread.png

Consumer Poll Thread

Consumer-Poll-Thread.png