Class IsotopeContext

java.lang.Object
ai.signalroom.kafka.isotope.IsotopeContext

public final class IsotopeContext extends Object
Thread-local handoff for the in-flight isotope between a consumer and a downstream producer in the same processing thread. In a typical consume-then-produce service, the application calls adoptFromRecord(ConsumerRecord) before processing each record so that IsotopeProducerInterceptor can find the inbound trace context and append the next hop instead of starting a new trace. The (record, service) overload additionally emits the stateless isotope.consume.age timer when the Micrometer exporter is enabled.

For bipartite topology visibility, consumers also call recordConsume(ConsumerRecord, String, Producer) to emit a best-effort consume-edge marker to "isotope_consume_edge_markers".