{"id":463099,"date":"2025-06-13T09:04:55","date_gmt":"2025-06-13T09:04:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=463099"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=463099","title":{"rendered":"<span>DLQ-first: \u0443\u0447\u0438\u043c Kafka-\u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u0430 \u043f\u0430\u0434\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u00a0\u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c Kafka\u2011\u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u043f\u0430\u0434\u0451\u0442 \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0432\u043e\u0439\u00a0\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u0430\u00a0\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u043e\u0436\u0438\u0442 \u0431\u0438\u0442\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u00a0Dead Letter Queue (DLQ). <\/p>\n<hr\/>\n<h2>\u041a\u043e\u0433\u0434\u0430 \u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d DLQ<\/h2>\n<p>\u0412\u00a0Kafka \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0434\u0432\u0435 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"121\" width=\"121\">\n<p align=\"left\">\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e\u00a0\u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437\u00a0DLQ<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e\u00a0\u0445\u043e\u0442\u0438\u043c \u0432\u0438\u0434\u0435\u0442\u044c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"left\"><strong>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043f\u043e\u043f\u044b\u0442\u043a\u0430 <code>deserialise \u2192 enrich \u2192 persist<\/code>; \u043f\u0440\u0438\u00a0\u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u0435 <em>offset<\/em> \u043d\u0435\u00a0\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043a \u0441\u0442\u043e\u043f\u043e\u0440\u0438\u0442\u0441\u044f.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442 \u043e\u0444\u0444\u0441\u0435\u0442, \u0430\u00a0\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 \u0432\u00a0DLQ\u2011\u0442\u043e\u043f\u0438\u043a.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"left\"><strong>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e\u043f\u0438\u043a\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0434\u043e\u0441\u0430\u0436\u0434\u0430\u0442\u044c\u00bb \u0440\u0435\u0442\u0440\u0430\u044f\u043c\u0438 \u0434\u043e\u00a0\u043a\u043e\u043d\u0446\u0430 \u0440\u0435\u0442\u0435\u043d\u0448\u0435\u043d\u0430.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0451\u0442\u043a\u043e \u0437\u043d\u0430\u0435\u043c: \u00ab\u0432 DLQ \u043b\u0435\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u044d\u0439\u043b\u044b, \u043f\u0440\u043e\u0434 \u0441\u0442\u0440\u0438\u043c \u0438\u0434\u0451\u0442 \u0434\u0430\u043b\u044c\u0448\u0435\u00bb.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f<\/p>\n<\/th>\n<th data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u0430\u044f?<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u041d\u0435\u2011\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \/ Avro\u2011\u0441\u0445\u0435\u043c\u0430<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\"><strong>Fatal<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0430\u0437\u0443 \u0432\u00a0DLQ, \u0441\u043c\u044b\u0441\u043b\u0430 \u0440\u0435\u0442\u0440\u0430\u0438\u0442\u044c \u043d\u0435\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0411\u0414<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\"><strong>Retryable<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">DLQ \u0441\u00a0\u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c re\u2011consume \u043f\u043e\u0441\u043b\u0435 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u041d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0445\u0435\u043c\u044b (schema registry lag)<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\"><strong>Retryable<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041b\u0438\u0431\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 retry,\u00a0\u043b\u0438\u0431\u043e DLQ \u2192 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0439 \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Confluent \u0438 \u0440\u044f\u0434 \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443: \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 <em>fatal<\/em> \u0438 <em>retryable<\/em>, \u043c\u0435\u0442\u0438\u0442\u0435 \u0438\u0445 \u0432\u00a0header (<code>error.class<\/code>, <code>error.stacktrace<\/code>, <code>retryable=true\/false<\/code>). <\/p>\n<p>\u0413\u0434\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 DLQ \u043d\u0435\u0442?<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043d\u0430\u00a0\u044f\u0434\u043e\u0432\u0438\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438, \u043e\u0444\u0444\u0441\u0435\u0442\u044b \u043d\u0435\u00a0\u043a\u043e\u043c\u043c\u0438\u0442\u044f\u0442\u0441\u044f, <em>\u0432\u0441\u0451<\/em> \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u043d\u0435\u00a0\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>DevOps \u0443\u0431\u0438\u0432\u0430\u0435\u0442 pod\u00a0\u2014 Kubernetes \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442,\u00a0\u2014 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0435\u0440\u0435\u0437 N \u0447\u0430\u0441\u043e\u0432 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u0448 SRE \u0438 \u0437\u0430\u0434\u0430\u0451\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u00ab\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u00a0\u0442\u043e\u043f\u0438\u043a\u0435 lag 50\u00a0\u043c\u043b\u043d, \u0430\u00a0\u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u0451\u0440\u0442\u0432?\u00bb<\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f DLQ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Kafka Consumer<\/h2>\n<h4>Python (confluent-kafka)<\/h4>\n<pre><code class=\"python\">from confluent_kafka import Consumer, Producer, KafkaException import json, logging, time  # \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 common = {     \"bootstrap.servers\": \"kafka-prod:9092\",     \"group.id\":          \"enricher-v1\",     \"auto.offset.reset\": \"earliest\",     \"enable.auto.commit\": False, }  consumer = Consumer(common | {\"key.deserializer\": str}) producer = Producer({\"bootstrap.servers\": common[\"bootstrap.servers\"]})  SOURCE_TOPIC = \"clicks.raw\" DLQ_TOPIC    = f\"{SOURCE_TOPIC}.dlq\"  def push_dlq(msg, exc, retryable: bool):     \"\"\"\u041f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 DLQ c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c\u0438 headers.\"\"\"     headers = msg.headers() or []     headers.extend([         (\"error.class\", str(type(exc)).encode()),         (\"error.message\", str(exc).encode()),         (\"retryable\", b\"1\" if retryable else b\"0\"),         (\"ts.failed\", str(int(time.time() * 1000)).encode()),     ])     producer.produce(         topic=DLQ_TOPIC,         key=msg.key(),         value=msg.value(),         headers=headers,     )     producer.flush(1_000)  def handle(msg):     payload = json.loads(msg.value())           # \u043c\u043e\u0436\u0435\u0442 \u043a\u0438\u043d\u0443\u0442\u044c JSONDecodeError     enriched = call_some_db(payload[\"user_id\"]) # \u043c\u043e\u0436\u0435\u0442 \u043a\u0438\u043d\u0443\u0442\u044c DBError     publish_downstream(enriched)  while True:     batch = consumer.consume(num_messages=500, timeout=1.0)     for m in batch:         try:             handle(m)             consumer.commit(m)  # \u0440\u0443\u0447\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u21d2 at-least-once         except json.JSONDecodeError as je:             logging.exception(\"Bad JSON\")             push_dlq(m, je, retryable=False)             consumer.commit(m)         except TransientDBError as te:             logging.warning(\"DB temp issue \u2192 DLQ for later retry\")             push_dlq(m, te, retryable=True)             consumer.commit(m)         except Exception as e:             # last-line defense             push_dlq(m, e, retryable=False)             consumer.commit(m)<\/code><\/pre>\n<p><strong>\u041a\u043e\u043c\u043c\u0438\u0442 \u043e\u0444\u0444\u0441\u0435\u0442\u0430<\/strong> \u043f\u043e\u0441\u043b\u0435 \u043f\u0443\u0448\u0430 \u0432\u00a0DLQ\u00a0\u2014 \u0438\u043d\u0430\u0447\u0435 \u043c\u044b\u00a0\u0431\u044b \u00ab\u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438\u00bb \u043d\u0430\u00a0\u043f\u043b\u043e\u0445\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438. <strong>retryable header<\/strong>\u00a0\u2014 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043c\u0443 \u0440\u0435\u0442\u0440\u0430\u044e. <code>producer.flush()<\/code>\u00a0\u2014 \u0432\u00a0\u043f\u0440\u043e\u0434\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u00a0\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 <em>delivery callback<\/em> + back\u2011pressure.<\/p>\n<h4>Java (Spring Kafka \u2265 2.8)<\/h4>\n<p>\u0423\u00a0Spring \u0432\u0441\u0451 \u0438\u0437\u00a0\u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <code>DefaultErrorHandler<\/code> \u0438 <code>DeadLetterPublishingRecoverer<\/code>:<\/p>\n<pre><code class=\"java\">@Bean public ConcurrentKafkaListenerContainerFactory&lt;String, OrderEvt&gt; kafkaFactory(         ConsumerFactory&lt;String, OrderEvt&gt; cf,         KafkaOperations&lt;String, OrderEvt&gt; dlqTemplate) {      var recoverer = new DeadLetterPublishingRecoverer(         dlqTemplate,         (rec, ex) -&gt; new TopicPartition(rec.topic() + \".dlq\", rec.partition())     );      var errorHandler = new DefaultErrorHandler(         recoverer,         new FixedBackOff(0L, 0) \/\/ \u0441\u0440\u0430\u0437\u0443 \u0432 DLQ, \u0431\u0435\u0437 \u0440\u0435\u0442\u0440\u0430\u0435\u0432     );      errorHandler.addNotRetryableExceptions(JsonParseException.class);     errorHandler.addRetryableExceptions(SQLException.class);      var factory = new ConcurrentKafkaListenerContainerFactory&lt;String, OrderEvt&gt;();     factory.setConsumerFactory(cf);     factory.setCommonErrorHandler(errorHandler);     return factory; }  @KafkaListener(topics = \"orders.raw\", groupId = \"enricher-v1\") public void onEvent(OrderEvt evt) {     \/\/ enrich &amp; persist }<\/code><\/pre>\n<p><code>DeadLetterPublishingRecoverer<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 key\/value \u0438 \u0434\u043e\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u0442\u0443 (<code>kafka_dlt-original-topic<\/code>, <code>kafka_dlt-exception-fqcn<\/code>, &amp; \u0434\u0440.). \u0414\u043b\u044f\u00a0\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <code>FixedBackOff(1000L, 3)<\/code>\u00a0\u2014 \u0442\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0442\u0440\u0430\u044f \u0434\u043e\u00a0DLQ.<\/p>\n<p>Spring\u2011team \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u043b\u0430 \u044d\u0442\u0438 \u0444\u0438\u0447\u0438 \u0441\u00a0Apache Kafka 2.8; \u0434\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 <code>SeekToCurrentErrorHandler<\/code>. <\/p>\n<h2>\u041a\u0430\u043a \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c DLQ <\/h2>\n<h4>\u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u0430\u043b\u0451\u0440\u0442\u044b<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0427\u0442\u043e\u00a0\u0441\u043c\u043e\u0442\u0440\u0438\u043c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0413\u0434\u0435 \u0431\u0435\u0440\u0451\u043c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u043e\u0440\u043e\u0433<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><code>records.in<\/code> \u0434\u043b\u044f <code>*.dlq<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>kafka.server.BrokerTopicMetrics.MessagesInPerSec<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">&gt;10% \u043e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0442\u043e\u043f\u0438\u043a\u0430 (5-\u043c\u0438\u043d. \u043e\u043a\u043d\u043e)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Lag \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e consumer\u2011group<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>kafka.consumer:type=consumer-fetch-manager-metrics<\/code> \u2192 <code>records-lag-max<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0440\u043e\u0441\u0442 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041a\u043e\u043b\u2011\u0432\u043e <code>retryable=true<\/code> \u0432\u00a0DLQ<\/p>\n<\/td>\n<td>\n<p align=\"left\">ksqlDB \/ Kafka Streams window count<\/p>\n<\/td>\n<td>\n<p align=\"left\">&gt;1000\u00a0\u0437\u0430 15\u00a0\u043c<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0430\u043b\u0435\u0440\u0442\u2011\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u00a0Prometheus:<\/p>\n<pre><code class=\"yaml\">- alert: HighDLQInRate   expr: rate(kafka_server_brokertopicmetrics_messages_in_total{topic=~\".*\\\\.dlq\"}[5m]) &gt; 100   for: 2m   labels:     severity: critical   annotations:     summary: \"DLQ inflow is {{ $value }} msg\/s\"     description: \"Too many errors hitting DLQ topics\"<\/code><\/pre>\n<h3>UI \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u0432\u044c\u044e<\/h3>\n<p><strong>kcat<\/strong> (<code>kafkacat<\/code>)\u00a0\u2014\u00a0\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>kcat -C -t clicks.raw.dlq -o -5 -q<\/code><\/pre>\n<p><strong>AKHQ \/ Redpanda Console \/ Confluent UI<\/strong>\u00a0\u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u00a0key\/headers. \u041a\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447, \u0434\u0435\u043b\u0430\u044e\u0442 \u00abDLQ\u2011WorkBench\u00bb: \u0443\u0434\u043e\u0431\u043d\u043e\u0435 SPA, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e <code>error.class<\/code>, \u0434\u0435\u043b\u0430\u0442\u044c bulk\u2011reprocess.<\/p>\n<h4>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 retry-pipeline<\/h4>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0430\u043a\u043e\u0432:<\/p>\n<pre><code>clicks.raw.dlq (-- only retryable --&gt;) clicks.retry          |                                   |          | DLQ-retry-consumer                | primary-consumer          +----------&gt;  clicks.raw -----------+<\/code><\/pre>\n<p><strong>Retry\u2011consumer<\/strong> \u0447\u0438\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>retryable=true<\/code>. \u0421\u0442\u0430\u0432\u0438\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>sleep(300_000)<\/code> \u0438\u043b\u0438 <em>Scheduled Executor<\/em>). \u041f\u0443\u0448\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u00a0\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u0441\u00a0\u043d\u043e\u0432\u044b\u043c header <code>x-retry-count<\/code>. \u041f\u0440\u0438\u00a0\u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 <code>MAX_RETRY<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 <code>clicks.raw.dlq.permanent<\/code>\u00a0\u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0437\u043e\u043d\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430.<\/p>\n<p>\u0412 2024-\u043c Confluent \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u00a0\u2014 <em>Parallel Consumer<\/em> \u0441\u00a0built\u2011in retry\u00a0\u2014 \u043d\u043e\u00a0\u043e\u043d \u043f\u043e\u043a\u0430 \u0432\u00a0tech\u2011preview. <\/p>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>DLQ\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u043a\u043e\u0440\u0437\u0438\u043d\u043a\u0430 \u0434\u043b\u044f\u00a0\u0431\u0438\u0442\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u00bb, \u0430\u00a0\u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><strong>\u041a\u043e\u043c\u043c\u0438\u0442 \u043e\u0444\u0444\u0441\u0435\u0442\u0430 \u2192 \u0436\u0438\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u2192 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0442\u0440\u0430\u0438<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u2192 SRE \u0441\u043f\u0438\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0431\u0440\u0430\u043b\u0438? \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u00a0\u2014 \u0448\u0432\u044b\u0440\u044f\u0435\u043c \u043a\u0440\u0438\u0432\u043e\u0439 JSON \u0438 \u0434\u0440\u043e\u043f\u0430\u0435\u043c \u043a\u043e\u043d\u043d\u0435\u043a\u0442 \u043a\u00a0\u0411\u0414. \u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u0443\u043b\u044b\u0431\u0430\u0435\u0442\u0441\u044f, \u0430\u00a0\u0432\u00a0DLQ \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0438: \u043e\u0434\u043d\u0430 <code>retryable=false<\/code>, \u0432\u0442\u043e\u0440\u0430\u044f <code>retryable=true<\/code>. \u041a\u0440\u0430\u0441\u043e\u0442\u0430.<\/p>\n<hr\/>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 <em>\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a 22 \u043c\u0430\u044f \u00ab\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f Nginx \u0438 Angie \u043f\u043e\u0434 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438\u00bb.<\/em> \u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0435, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c TLS, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041c\u0435\u043d\u044c\u0448\u0435 \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. <a href=\"https:\/\/otus.pw\/Whhd\/\">\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.<\/a><\/p>\n<blockquote>\n<p><em>\u041b\u044e\u0431\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0447\u0435\u0441\u0442\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438. \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 <\/em><a href=\"https:\/\/otus.pw\/gF7w\/\"><em>\u0442\u0435\u0441\u0442 \u043d\u0430 \u0437\u043d\u0430\u043d\u0438\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/em><\/a><em> \u2014 \u043e\u043d \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442, \u043a\u0443\u0434\u0430 \u0440\u0430\u0441\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435.<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905810\/\"> https:\/\/habr.com\/ru\/articles\/905810\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u00a0\u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c Kafka\u2011\u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u043f\u0430\u0434\u0451\u0442 \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0432\u043e\u0439\u00a0\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u0430\u00a0\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0441\u043b\u043e\u0436\u0438\u0442 \u0431\u0438\u0442\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u00a0Dead Letter Queue (DLQ). <\/p>\n<hr\/>\n<h2>\u041a\u043e\u0433\u0434\u0430 \u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d DLQ<\/h2>\n<p>\u0412\u00a0Kafka \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0434\u0432\u0435 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"121\" width=\"121\">\n<p align=\"left\">\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e\u00a0\u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437\u00a0DLQ<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u043e\u00a0\u0445\u043e\u0442\u0438\u043c \u0432\u0438\u0434\u0435\u0442\u044c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"left\"><strong>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043f\u043e\u043f\u044b\u0442\u043a\u0430 <code>deserialise \u2192 enrich \u2192 persist<\/code>; \u043f\u0440\u0438\u00a0\u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u0435 <em>offset<\/em> \u043d\u0435\u00a0\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043a \u0441\u0442\u043e\u043f\u043e\u0440\u0438\u0442\u0441\u044f.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442 \u043e\u0444\u0444\u0441\u0435\u0442, \u0430\u00a0\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 \u0432\u00a0DLQ\u2011\u0442\u043e\u043f\u0438\u043a.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"121\" width=\"121\">\n<p align=\"left\"><strong>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e\u043f\u0438\u043a\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0434\u043e\u0441\u0430\u0436\u0434\u0430\u0442\u044c\u00bb \u0440\u0435\u0442\u0440\u0430\u044f\u043c\u0438 \u0434\u043e\u00a0\u043a\u043e\u043d\u0446\u0430 \u0440\u0435\u0442\u0435\u043d\u0448\u0435\u043d\u0430.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0451\u0442\u043a\u043e \u0437\u043d\u0430\u0435\u043c: \u00ab\u0432 DLQ \u043b\u0435\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u044d\u0439\u043b\u044b, \u043f\u0440\u043e\u0434 \u0441\u0442\u0440\u0438\u043c \u0438\u0434\u0451\u0442 \u0434\u0430\u043b\u044c\u0448\u0435\u00bb.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f<\/p>\n<\/th>\n<th data-colwidth=\"154\" width=\"154\">\n<p align=\"left\">\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c\u0430\u044f?<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u041d\u0435\u2011\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \/ Avro\u2011\u0441\u0445\u0435\u043c\u0430<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\"><strong>Fatal<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0430\u0437\u0443 \u0432\u00a0DLQ, \u0441\u043c\u044b\u0441\u043b\u0430 \u0440\u0435\u0442\u0440\u0430\u0438\u0442\u044c \u043d\u0435\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0411\u0414<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\"><strong>Retryable<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">DLQ \u0441\u00a0\u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c re\u2011consume \u043f\u043e\u0441\u043b\u0435 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"242\" width=\"242\">\n<p align=\"left\">\u041d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0445\u0435\u043c\u044b (schema registry lag)<\/p>\n<\/td>\n<td data-colwidth=\"154\" width=\"154\">\n<p align=\"left\"><strong>Retryable<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041b\u0438\u0431\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 retry,\u00a0\u043b\u0438\u0431\u043e DLQ \u2192 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0439 \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Confluent \u0438 \u0440\u044f\u0434 \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443: \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0439\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 <em>fatal<\/em> \u0438 <em>retryable<\/em>, \u043c\u0435\u0442\u0438\u0442\u0435 \u0438\u0445 \u0432\u00a0header (<code>error.class<\/code>, <code>error.stacktrace<\/code>, <code>retryable=true\/false<\/code>). <\/p>\n<p>\u0413\u0434\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 DLQ \u043d\u0435\u0442?<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043d\u0430\u00a0\u044f\u0434\u043e\u0432\u0438\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438, \u043e\u0444\u0444\u0441\u0435\u0442\u044b \u043d\u0435\u00a0\u043a\u043e\u043c\u043c\u0438\u0442\u044f\u0442\u0441\u044f, <em>\u0432\u0441\u0451<\/em> \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u043d\u0435\u00a0\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>DevOps \u0443\u0431\u0438\u0432\u0430\u0435\u0442 pod\u00a0\u2014 Kubernetes \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442,\u00a0\u2014 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0435\u0440\u0435\u0437 N \u0447\u0430\u0441\u043e\u0432 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u0448 SRE \u0438 \u0437\u0430\u0434\u0430\u0451\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u00ab\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u00a0\u0442\u043e\u043f\u0438\u043a\u0435 lag 50\u00a0\u043c\u043b\u043d, \u0430\u00a0\u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u0451\u0440\u0442\u0432?\u00bb<\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f DLQ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Kafka Consumer<\/h2>\n<h4>Python (confluent-kafka)<\/h4>\n<pre><code class=\"python\">from confluent_kafka import Consumer, Producer, KafkaException import json, logging, time  # \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 common = {     \"bootstrap.servers\": \"kafka-prod:9092\",     \"group.id\":          \"enricher-v1\",     \"auto.offset.reset\": \"earliest\",     \"enable.auto.commit\": False, }  consumer = Consumer(common | {\"key.deserializer\": str}) producer = Producer({\"bootstrap.servers\": common[\"bootstrap.servers\"]})  SOURCE_TOPIC = \"clicks.raw\" DLQ_TOPIC    = f\"{SOURCE_TOPIC}.dlq\"  def push_dlq(msg, exc, retryable: bool):     \"\"\"\u041f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 DLQ c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c\u0438 headers.\"\"\"     headers = msg.headers() or []     headers.extend([         (\"error.class\", str(type(exc)).encode()),         (\"error.message\", str(exc).encode()),         (\"retryable\", b\"1\" if retryable else b\"0\"),         (\"ts.failed\", str(int(time.time() * 1000)).encode()),     ])     producer.produce(         topic=DLQ_TOPIC,         key=msg.key(),         value=msg.value(),         headers=headers,     )     producer.flush(1_000)  def handle(msg):     payload = json.loads(msg.value())           # \u043c\u043e\u0436\u0435\u0442 \u043a\u0438\u043d\u0443\u0442\u044c JSONDecodeError     enriched = call_some_db(payload[\"user_id\"]) # \u043c\u043e\u0436\u0435\u0442 \u043a\u0438\u043d\u0443\u0442\u044c DBError     publish_downstream(enriched)  while True:     batch = consumer.consume(num_messages=500, timeout=1.0)     for m in batch:         try:             handle(m)             consumer.commit(m)  # \u0440\u0443\u0447\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u21d2 at-least-once         except json.JSONDecodeError as je:             logging.exception(\"Bad JSON\")             push_dlq(m, je, retryable=False)             consumer.commit(m)         except TransientDBError as te:             logging.warning(\"DB temp issue \u2192 DLQ for later retry\")             push_dlq(m, te, retryable=True)             consumer.commit(m)         except Exception as e:             # last-line defense             push_dlq(m, e, retryable=False)             consumer.commit(m)<\/code><\/pre>\n<p><strong>\u041a\u043e\u043c\u043c\u0438\u0442 \u043e\u0444\u0444\u0441\u0435\u0442\u0430<\/strong> \u043f\u043e\u0441\u043b\u0435 \u043f\u0443\u0448\u0430 \u0432\u00a0DLQ\u00a0\u2014 \u0438\u043d\u0430\u0447\u0435 \u043c\u044b\u00a0\u0431\u044b \u00ab\u0437\u0430\u0441\u0442\u0440\u044f\u043b\u0438\u00bb \u043d\u0430\u00a0\u043f\u043b\u043e\u0445\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438. <strong>retryable header<\/strong>\u00a0\u2014 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043c\u0443 \u0440\u0435\u0442\u0440\u0430\u044e. <code>producer.flush()<\/code>\u00a0\u2014 \u0432\u00a0\u043f\u0440\u043e\u0434\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u00a0\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 <em>delivery callback<\/em> + back\u2011pressure.<\/p>\n<h4>Java (Spring Kafka \u2265 2.8)<\/h4>\n<p>\u0423\u00a0Spring \u0432\u0441\u0451 \u0438\u0437\u00a0\u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <code>DefaultErrorHandler<\/code> \u0438 <code>DeadLetterPublishingRecoverer<\/code>:<\/p>\n<pre><code class=\"java\">@Bean public ConcurrentKafkaListenerContainerFactory&lt;String, OrderEvt&gt; kafkaFactory(         ConsumerFactory&lt;String, OrderEvt&gt; cf,         KafkaOperations&lt;String, OrderEvt&gt; dlqTemplate) {      var recoverer = new DeadLetterPublishingRecoverer(         dlqTemplate,         (rec, ex) -&gt; new TopicPartition(rec.topic() + \".dlq\", rec.partition())     );      var errorHandler = new DefaultErrorHandler(         recoverer,         new FixedBackOff(0L, 0) \/\/ \u0441\u0440\u0430\u0437\u0443 \u0432 DLQ, \u0431\u0435\u0437 \u0440\u0435\u0442\u0440\u0430\u0435\u0432     );      errorHandler.addNotRetryableExceptions(JsonParseException.class);     errorHandler.addRetryableExceptions(SQLException.class);      var factory = new ConcurrentKafkaListenerContainerFactory&lt;String, OrderEvt&gt;();     factory.setConsumerFactory(cf);     factory.setCommonErrorHandler(errorHandler);     return factory; }  @KafkaListener(topics = \"orders.raw\", groupId = \"enricher-v1\") public void onEvent(OrderEvt evt) {     \/\/ enrich &amp; persist }<\/code><\/pre>\n<p><code>DeadLetterPublishingRecoverer<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 key\/value \u0438 \u0434\u043e\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u0442\u0443 (<code>kafka_dlt-original-topic<\/code>, <code>kafka_dlt-exception-fqcn<\/code>, &amp; \u0434\u0440.). \u0414\u043b\u044f\u00a0\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <code>FixedBackOff(1000L, 3)<\/code>\u00a0\u2014 \u0442\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0442\u0440\u0430\u044f \u0434\u043e\u00a0DLQ.<\/p>\n<p>Spring\u2011team \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u043b\u0430 \u044d\u0442\u0438 \u0444\u0438\u0447\u0438 \u0441\u00a0Apache Kafka 2.8; \u0434\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 <code>SeekToCurrentErrorHandler<\/code>. <\/p>\n<h2>\u041a\u0430\u043a \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c DLQ <\/h2>\n<h4>\u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u0430\u043b\u0451\u0440\u0442\u044b<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0427\u0442\u043e\u00a0\u0441\u043c\u043e\u0442\u0440\u0438\u043c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0413\u0434\u0435 \u0431\u0435\u0440\u0451\u043c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u043e\u0440\u043e\u0433<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><code>records.in<\/code> \u0434\u043b\u044f <code>*.dlq<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>kafka.server.BrokerTopicMetrics.MessagesInPerSec<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">&gt;10% \u043e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0442\u043e\u043f\u0438\u043a\u0430 (5-\u043c\u0438\u043d. \u043e\u043a\u043d\u043e)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Lag \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e consumer\u2011group<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>kafka.consumer:type=consumer-fetch-manager-metrics<\/code> \u2192 <code>records-lag-max<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0440\u043e\u0441\u0442 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041a\u043e\u043b\u2011\u0432\u043e <code>retryable=true<\/code> \u0432\u00a0DLQ<\/p>\n<\/td>\n<td>\n<p align=\"left\">ksqlDB \/ Kafka Streams window count<\/p>\n<\/td>\n<td>\n<p align=\"left\">&gt;1000\u00a0\u0437\u0430 15\u00a0\u043c<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0430\u043b\u0435\u0440\u0442\u2011\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u00a0Prometheus:<\/p>\n<pre><code class=\"yaml\">- alert: HighDLQInRate   expr: rate(kafka_server_brokertopicmetrics_messages_in_total{topic=~\".*\\\\.dlq\"}[5m]) &gt; 100   for: 2m   labels:     severity: critical   annotations:     summary: \"DLQ inflow is {{ $value }} msg\/s\"     description: \"Too many errors hitting DLQ topics\"<\/code><\/pre>\n<h3>UI \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0440\u0435\u0432\u044c\u044e<\/h3>\n<p><strong>kcat<\/strong> (<code>kafkacat<\/code>)\u00a0\u2014\u00a0\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>kcat -C -t clicks.raw.dlq -o -5 -q<\/code><\/pre>\n<p><strong>AKHQ \/ Redpanda Console \/ Confluent UI<\/strong>\u00a0\u2014 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u00a0key\/headers. \u041a\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447, \u0434\u0435\u043b\u0430\u044e\u0442 \u00abDLQ\u2011WorkBench\u00bb: \u0443\u0434\u043e\u0431\u043d\u043e\u0435 SPA, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e <code>error.class<\/code>, \u0434\u0435\u043b\u0430\u0442\u044c bulk\u2011reprocess.<\/p>\n<h4>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 retry-pipeline<\/h4>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0430\u043a\u043e\u0432:<\/p>\n<pre><code>clicks.raw.dlq (-- only retryable --&gt;) clicks.retry          |                                   |          | DLQ-retry-consumer                | primary-consumer          +----------&gt;  clicks.raw -----------+<\/code><\/pre>\n<p><strong>Retry\u2011consumer<\/strong> \u0447\u0438\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>retryable=true<\/code>. \u0421\u0442\u0430\u0432\u0438\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>sleep(300_000)<\/code> \u0438\u043b\u0438 <em>Scheduled Executor<\/em>). \u041f\u0443\u0448\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u00a0\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u043e\u043f\u0438\u043a \u0441\u00a0\u043d\u043e\u0432\u044b\u043c header <code>x-retry-count<\/code>. \u041f\u0440\u0438\u00a0\u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 <code>MAX_RETRY<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 <code>clicks.raw.dlq.permanent<\/code>\u00a0\u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0437\u043e\u043d\u0430 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430.<\/p>\n<p>\u0412 2024-\u043c Confluent \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u00a0\u2014 <em>Parallel Consumer<\/em> \u0441\u00a0built\u2011in retry\u00a0\u2014 \u043d\u043e\u00a0\u043e\u043d \u043f\u043e\u043a\u0430 \u0432\u00a0tech\u2011preview. <\/p>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>DLQ\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u043a\u043e\u0440\u0437\u0438\u043d\u043a\u0430 \u0434\u043b\u044f\u00a0\u0431\u0438\u0442\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u00bb, \u0430\u00a0\u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><strong>\u041a\u043e\u043c\u043c\u0438\u0442 \u043e\u0444\u0444\u0441\u0435\u0442\u0430 \u2192 \u0436\u0438\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u2192 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0442\u0440\u0430\u0438<\/strong>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u2192 SRE \u0441\u043f\u0438\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e<\/strong>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0431\u0440\u0430\u043b\u0438? \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u00a0\u2014 \u0448\u0432\u044b\u0440\u044f\u0435\u043c \u043a\u0440\u0438\u0432\u043e\u0439 JSON \u0438 \u0434\u0440\u043e\u043f\u0430\u0435\u043c \u043a\u043e\u043d\u043d\u0435\u043a\u0442 \u043a\u00a0\u0411\u0414. \u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u0443\u043b\u044b\u0431\u0430\u0435\u0442\u0441\u044f, \u0430\u00a0\u0432\u00a0DLQ \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0438: \u043e\u0434\u043d\u0430 <code>retryable=false<\/code>, \u0432\u0442\u043e\u0440\u0430\u044f <code>retryable=true<\/code>. \u041a\u0440\u0430\u0441\u043e\u0442\u0430.<\/p>\n<hr\/>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 <em>\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a 22 \u043c\u0430\u044f \u00ab\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f Nginx \u0438 Angie \u043f\u043e\u0434 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438\u00bb.<\/em> \u0423\u0437\u043d\u0430\u0439\u0442\u0435, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0435, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c TLS, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041c\u0435\u043d\u044c\u0448\u0435 \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. <a href=\"https:\/\/otus.pw\/Whhd\/\">\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.<\/a><\/p>\n<blockquote>\n<p><em>\u041b\u044e\u0431\u043e\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0447\u0435\u0441\u0442\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438. \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 <\/em><a href=\"https:\/\/otus.pw\/gF7w\/\"><em>\u0442\u0435\u0441\u0442 \u043d\u0430 \u0437\u043d\u0430\u043d\u0438\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/em><\/a><em> \u2014 \u043e\u043d \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442, \u043a\u0443\u0434\u0430 \u0440\u0430\u0441\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435.<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905810\/\"> https:\/\/habr.com\/ru\/articles\/905810\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-463099","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=463099"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463099\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=463099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=463099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=463099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}