From 4073897efccd74209629e85d52a9c1b5eb56d8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A1=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2=D1=8C=D0=B5=D0=B2?= Date: Mon, 25 May 2026 15:05:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BC=D0=B0=D1=81=D1=88=D1=82=D0=B0=D0=B1=D0=B8=D1=80?= =?UTF-8?q?=D1=83=D0=B5=D0=BC=D1=8B=D0=B9=20outbox=20worker=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=B0=D1=81=D0=BF=D0=BE=D1=80=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BC=D0=B0=D1=80=D1=88=D1=80=D1=83=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - добавить properties и config values для route passport outbox worker - включить Spring scheduling в route-processing service - добавить транзакционный сервис claim и status transitions для outbox - публиковать claimed outbox rows через существующий Kafka publisher - обрабатывать publish failures по каждой row с bounded exponential backoff - обеспечить безопасность при нескольких pod через FOR UPDATE SKIP LOCKED и lockedUntil - добавить unit tests для claim, publish transitions, retry/fail behavior и batch-обработки worker --- config-repo/pcp-route-processing-service.yaml | 7 +++++++ .../RoutePassportConsumerApplication.kt | 2 ++ 2 files changed, 9 insertions(+) diff --git a/config-repo/pcp-route-processing-service.yaml b/config-repo/pcp-route-processing-service.yaml index 5828e64..f17beee 100644 --- a/config-repo/pcp-route-processing-service.yaml +++ b/config-repo/pcp-route-processing-service.yaml @@ -54,6 +54,13 @@ app: max-attempts: 3 backoff-ms: 1000 max-backoff-ms: 30000 + outbox: + enabled: true + batch-size: 50 + fixed-delay-ms: 1000 + lock-timeout-ms: 60000 + initial-backoff-ms: 1000 + max-backoff-ms: 60000 kafka: topics: input: pcp.request.survey-georeference.v1 diff --git a/services/pcp-route-processing-service/src/main/kotlin/space/nstart/pcp/routepassportconsumer/RoutePassportConsumerApplication.kt b/services/pcp-route-processing-service/src/main/kotlin/space/nstart/pcp/routepassportconsumer/RoutePassportConsumerApplication.kt index 09ee37b..a9e6946 100644 --- a/services/pcp-route-processing-service/src/main/kotlin/space/nstart/pcp/routepassportconsumer/RoutePassportConsumerApplication.kt +++ b/services/pcp-route-processing-service/src/main/kotlin/space/nstart/pcp/routepassportconsumer/RoutePassportConsumerApplication.kt @@ -4,6 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.context.properties.ConfigurationPropertiesScan import org.springframework.boot.runApplication import org.springframework.kafka.annotation.EnableKafka +import org.springframework.scheduling.annotation.EnableScheduling /** * Главный класс Spring Boot приложения. @@ -13,6 +14,7 @@ import org.springframework.kafka.annotation.EnableKafka @ConfigurationPropertiesScan @SpringBootApplication @EnableKafka +@EnableScheduling class RoutePassportConsumerApplication /**