Class CorrelationManager
java.lang.Object
io.kroxylicious.proxy.internal.codec.CorrelationManager
Manages correlation ids for a single connection (across the proxy) between a single client
and a single broker.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA record for which responses should be decoded, together with their API key and version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBrokerCorrelation(int upstreamCorrelationId) Find (and remove) the Correlation for an incoming response from the brokerintputBrokerRequest(short apiKey, short apiVersion, int downstreamCorrelationId, boolean hasResponse, io.kroxylicious.proxy.filter.Filter recipient, CompletableFuture<?> promise, boolean decodeResponse) Allocate and return a correlation id for an outgoing request to the 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
Find (and remove) the Correlation for an incoming response from the broker- Parameters:
upstreamCorrelationId- The (upstream) correlation id in the response.
-