Сообщения

Сообщения за январь, 2025

Kafka

Изображение
 1. Create topic. Go to bin folder in kafka: kafka-topics.sh --create --topic test --bootstrap-server localhost:19092 --replication-factor 1 --partitions 1 2. Describe topic. Get information about topic: kafka-topics.sh --describe --topic test --bootstrap-server localhost:19092 3. Produce message: kafka-console-producer.sh --topic test --bootstrap-server localhost:19092 4. Consume message: kafka-console-consumer.sh --topic test --bootstrap-server localhost:19092 --from-beginning *  Keep in mind that the number of  partitions for a topic can only be increased, never decreased. *  KafkaProducer has two types of errors. Retriable errors are those that can be resolved by sending the message again. For example, a connection error can be resolved because the connection may get reestablished. A “no leader” error can be resolved when a new leader is elected for the partition. KafkaProducer can be configured to retry those errors automatically, so the application code will ...