Avoid automatic, unbounded requests on subscription

This commit is contained in:
Jon Chambers
2026-06-24 13:10:28 -04:00
committed by Jon Chambers
parent 1f0b2ad92d
commit fa4d3c7ca9
@@ -14,6 +14,7 @@ import java.util.function.BiConsumer;
import com.google.common.annotations.VisibleForTesting;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Metrics;
import org.reactivestreams.Subscription;
import org.whispersystems.textsecuregcm.metrics.MetricsUtil;
import org.whispersystems.textsecuregcm.storage.foundationdb.FoundationDbMessageStream;
import org.whispersystems.textsecuregcm.util.UUIDUtil;
@@ -80,6 +81,12 @@ public class AcknowledgementMirroringMessageStream implements MessageStream {
}
}
@Override
protected void hookOnSubscribe(final Subscription subscription) {
// The base `hookOnSubscribe` requests `Long.MAX_VALUE` elements, and that is something we're explicitly trying
// to avoid with this subscriber
}
@Override
protected void hookOnNext(final MessageStreamEntry.Envelope envelope) {
mirroredMessageHandler.accept(