kafka

13 items tagged with "kafka"

12 Articles
1 Diagram

Articles

java.lang.NoSuchMethodError: PoolConfig.setMinEvictableIdleTime

2022-08-27
Spark & PySpark

Streaming from Kafka to Delta Lake Table via PySpark

2022-08-26
Spark & PySpark

Subscribe to Multiple Topics in Kafka Consumer

When fetching records from Kafka bootstrap servers, we can specify one consumer to subscribe to more than one topic. This can be done in the init function by passing a list of topics: `` topics = ['kontext-events', 'other-events'] bootstrap_servers = 'localhost:9092' consumer = KafkaConsumer( *topics, client_id='local-test', bootstrapservers=bootstrapservers, autooffsetreset='earliest' ) ` Alternatively, we can use subscribe() function to subscribe to multiple topics. We can also regular expressions to match topics via patterns: ` subscribe(topics=(), pattern=None, listener=None) ``

2022-08-23
Code Snippets & Tips

Kafka Consumer - Fetch Records from Beginning

This code snippet reads data from topic's beginning offset by utilizing seektobeginning() API. This will sets each partitions subscribed by the consumers to fetch records from the earliest available offsets. Example output: polling... Kontext message 1 Kontext message 2 Kontext message 3 Kontext message 4 Kontext message 5 New kontext events~!! New events! polling... polling...

2022-08-22
Code Snippets & Tips

Retrieve Kafka Messages (Records) via Timestamp

2022-08-22
Streaming Analytics & Kafka

Python - Read Messages in Kafka Topic

This code snippet provides example of reading messages from Kafka topics. In common practices, one Kafka consumer is used to read from one partition for a topic; if there are multiple partitions for the same topic, each consumer can run in different servers or containers. Those consumers for different partitions are also configured within one consumer group. In this example, all partitions are assigned to the same consumer. This code snippet utilize Python package kafka-python. It can be installed via the following command if you have pip installed: `` pip install kafka-python ` Or we can also use built-in pip in Python 3: ` python -m pip install kafka-python `` References Apache Kafka Python Producer and Consumer Clients Introduction Install and Run Kafka 3.2.0 On WSL Install and Run Kafka 2.6.0 On Windows 10

2022-08-22
Code Snippets & Tips

Install and Run Kafka 3.2.0 On WSL

2022-06-15
Streaming Analytics & Kafka

Kafka Windows CLI Commands

2020-09-07
Streaming Analytics & Kafka

Spark Structured Streaming - Read from and Write into Kafka Topics

2020-09-06
Streaming Analytics & Kafka

Kafka Topic Partitions Walkthrough via Python

2020-09-06
Streaming Analytics & Kafka

Apache Kafka Python Producer and Consumer Clients Introduction

2020-09-05
Streaming Analytics & Kafka

Install and Run Kafka 2.6.0 On Windows 10

2020-08-30
Streaming Analytics & Kafka

Diagrams