@startuml Messaging Sequenzdiagramm group "Backend: Request produzieren und warten" Endpoint -> RequestReply: request(cmdW) RequestReply -> AtomicReference : <> RequestReply <-- AtomicReference : responseRef RequestReply -> RequestReply : responses.put(\nrequestId,\nresponseRef) RequestReply -> Kafka: produce(cmdW) RequestReply <-- Kafka : Ack RequestReply -> AtomicReference : wait() end note over Kafka : asynchron group "Persistence: Request konsumieren und enqueuen" Quarkus -> Kafka: poll() Quarkus <-- Kafka: cmdW Quarkus -> CommandObserver: process(cmdW) CommandObserver -> Transaction: get(txId) CommandObserver <-- Transaction: tx CommandObserver -> Transaction: queue(tx, cmdW) CommandObserver <-- Transaction Quarkus <-- CommandObserver Kafka <-- Quarkus : Ack end note over Transaction : asynchron group "Persistence: Request verarbeiten und Response produzieren" Transaction -> CommandWrapper : process(cmdW) CommandWrapper -> Command : <>\ndeserialize(cmdW) CommandWrapper <-- Command : cmd CommandWrapper -> Command : process(cmd) Command -> CDI : select(Class) Command <-- CDI : Processor Command -> Processor : process(cmd) note over Processor : Verarbeitung\ndes Commands Command <-- Processor : resp CommandWrapper <-- Command : resp Transaction <-- CommandWrapper : resp Transaction -> CommandResponse : serialize(resp).copyIds(cmdW) Transaction <-- CommandResponse : respW Transaction -> Interceptor : intercept(respW) note over Interceptor : (asynchron;\nDetails nicht\ndargestellt) Transaction <-- Interceptor Transaction -> Transaction : commit() Transaction -> Kafka : produce(respW) Transaction <-- Kafka : Ack end note over Kafka : asynchron group "Backend: Response konsumieren und benachrichtigen" RequestReply -> Kafka : poll() RequestReply <-- Kafka : respW RequestReply -> RequestReply : responses.get(requestId) RequestReply -> AtomicReference : set(respW) RequestReply <-- AtomicReference RequestReply -> AtomicReference : notifyAll() RequestReply <-- AtomicReference end note over RequestReply : asynchron group "Backend: Response zu Request zurückgeben" [synchron nach 1. Block, siehe oben] RequestReply <-- AtomicReference : wegen wait (siehe oben) RequestReply -> AtomicReference : get() RequestReply <-- AtomicReference : respW Endpoint <-- RequestReply : respW end @enduml