#419 · bluetape4k-projects · 2.0.0 · Sequence

NATS JetStream Flow: 하나의 cold 계약과 두 개의 입력 경로

ConsumerContext pull과 JetStream push가 하나의 bounded Flow<Message>로 합쳐지는 과정을 재생하고 caller 소유 acknowledgement, redelivery, drop, cancellation, terminal completion을 따라갑니다.

전달 시나리오를 선택하세요

분기 × 5

Sequence: NATS JetStream Flow: 하나의 cold 계약과 두 개의 입력 경로

단계 0 / 9
Sequence 진행1 · Cold Flow 선언
Caller / collectorack · nak · term 정책
cold Flow<Message>하나의 bounded 계약
NATS adapter자신이 만든 handle만 소유
JetStream / consumerserver delivery + 상태
  1. JetStream.consumeAsFlow(...) 또는 ConsumerContext.consumeAsFlow(...)
    1 · Cold Flow 선언대기
  2. collect → runInterruptible(Dispatchers.IO)
    2 · Collection이 adapter handle을 엽니다대기
  3. nextMessage(receiveTimeout) → send(message)
    3 · Pull과 push가 합쳐집니다대기
  4. emit(Message)
    5 · policy를 만들지 않고 전달합니다대기
  5. business work → message.ack()
    6 · Caller가 성공을 acknowledge합니다대기
  6. message.nak() / ack wait 만료 → redelivery
    7 · Nak 또는 unack가 redelivery를 드러냅니다대기
  7. droppedCount ↑ → NatsConsumerFlowException
    8 · Push drop은 typed failure가 됩니다대기
  8. cancel → receive interrupt → close / unsubscribe
    9 · Cancellation이 소유한 handle을 닫습니다대기
  9. message.term() 또는 consumer end → Flow completion
    10 · Terminal 선택과 completion대기

1 · Cold Flow 선언

대기

JetStream.consumeAsFlow(...) 또는 ConsumerContext.consumeAsFlow(...)

무엇을 하는가

무엇을 막는가

다음에는

보이는 신호