Class CorrelationManager

java.lang.Object
io.kroxylicious.proxy.internal.codec.CorrelationManager

public class CorrelationManager extends Object
Manages correlation ids for a single connection (across the proxy) between a single client and a single broker.
  • Constructor Details

    • CorrelationManager

      public CorrelationManager()
    • CorrelationManager

      public CorrelationManager(int initialCorrelationId)
  • Method Details

    • putBrokerRequest

      public int putBrokerRequest(short apiKey, short apiVersion, int downstreamCorrelationId, boolean hasResponse, @Nullable io.kroxylicious.proxy.filter.Filter recipient, @Nullable CompletableFuture<?> promise, boolean decodeResponse)
      Allocate and return a correlation id for an outgoing request to the broker.
      Parameters:
      apiKey - The API key.
      apiVersion - The API version.
      downstreamCorrelationId - The downstream client's correlation id.
      hasResponse - Whether a response is expected.
      promise - A promise.
      decodeResponse - Whether the response should be decoded.
    • getBrokerCorrelation

      public CorrelationManager.Correlation getBrokerCorrelation(int upstreamCorrelationId)
      Find (and remove) the Correlation for an incoming response from the broker
      Parameters:
      upstreamCorrelationId - The (upstream) correlation id in the response.