refactor: derive processor-route mapping from diagrams instead of executions
Some checks failed
CI / cleanup-branch (push) Has been skipped
CI / build (push) Failing after 37s
CI / docker (push) Has been skipped
CI / deploy (push) Has been skipped
CI / deploy-feature (push) Has been skipped

Store application_name in route_diagrams at ingestion time (V7 migration),
resolve from agent registry same as ExecutionController. Move
findProcessorRouteMapping from ExecutionStore to DiagramStore using a
JSONB query that extracts node IDs directly from stored RouteGraph
definitions. This makes the mapping available as soon as diagrams are
sent, before any executions are recorded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-26 23:00:10 +01:00
parent 100b780b47
commit d6c1f2c25b
8 changed files with 45 additions and 28 deletions

View File

@@ -8,4 +8,4 @@ import com.cameleer3.common.graph.RouteGraph;
* The agent ID is extracted from the SecurityContext in the controller layer
* and carried through the write buffer so the flush scheduler can persist it.
*/
public record TaggedDiagram(String agentId, RouteGraph graph) {}
public record TaggedDiagram(String agentId, String applicationName, RouteGraph graph) {}

View File

@@ -4,6 +4,7 @@ import com.cameleer3.common.graph.RouteGraph;
import com.cameleer3.server.core.ingestion.TaggedDiagram;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public interface DiagramStore {
@@ -15,4 +16,6 @@ public interface DiagramStore {
Optional<String> findContentHashForRoute(String routeId, String agentId);
Optional<String> findContentHashForRouteByAgents(String routeId, List<String> agentIds);
Map<String, String> findProcessorRouteMapping(String applicationName);
}

View File

@@ -2,7 +2,6 @@ package com.cameleer3.server.core.storage;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public interface ExecutionStore {
@@ -17,8 +16,6 @@ public interface ExecutionStore {
List<ProcessorRecord> findProcessors(String executionId);
Map<String, String> findProcessorRouteMapping(String applicationName);
record ExecutionRecord(
String executionId, String routeId, String agentId, String applicationName,
String status, String correlationId, String exchangeId,