Package io.kroxylicious.proxy.filter
Interface ResponseFilter
- All Superinterfaces:
Filter
A Filter that handles all response types.
When a Filter implements ResponseFilter:
- it must not also implement any of the message-specific
*ResponseFilterinterfaces likeApiVersionsResponseFilter. - it may also implement either
RequestFilteror any of the message-specific*RequestFilterinterfaces, but not both.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletionStage<ResponseFilterResult> onResponse(org.apache.kafka.common.protocol.ApiKeys apiKey, short apiVersion, org.apache.kafka.common.message.ResponseHeaderData header, org.apache.kafka.common.protocol.ApiMessage response, FilterContext context) Handle the givenheaderandresponsepair, returning theheaderandresponsepair to be passed to the next filter using the ResponseFilterResult.default CompletionStage<ResponseFilterResult> onResponse(org.apache.kafka.common.protocol.ApiKeys apiKey, org.apache.kafka.common.message.ResponseHeaderData header, org.apache.kafka.common.protocol.ApiMessage response, FilterContext context) Deprecated, for removal: This API element is subject to removal in a future version.default booleanshouldHandleResponse(org.apache.kafka.common.protocol.ApiKeys apiKey, short apiVersion) Does this filter implementation want to handle a response.
-
Method Details
-
shouldHandleResponse
default boolean shouldHandleResponse(org.apache.kafka.common.protocol.ApiKeys apiKey, short apiVersion) Does this filter implementation want to handle a response. If so, theonResponse(ApiKeys, short, ResponseHeaderData, ApiMessage, FilterContext)method will be eligible to be called with the deserialized response data (if the message reaches this filter in the filter chain).- Parameters:
apiKey- the api key of the messageapiVersion- the api version of the message- Returns:
- true if this filter wants to handle the response
-
onResponse
@Deprecated(forRemoval=true, since="0.19.0") default CompletionStage<ResponseFilterResult> onResponse(org.apache.kafka.common.protocol.ApiKeys apiKey, org.apache.kafka.common.message.ResponseHeaderData header, org.apache.kafka.common.protocol.ApiMessage response, FilterContext context) Deprecated, for removal: This API element is subject to removal in a future version.implementonResponse(ApiKeys, short, ResponseHeaderData, ApiMessage, FilterContext)instead.Handle the givenheaderandresponsepair, returning theheaderandresponsepair to be passed to the next filter using the ResponseFilterResult.
The implementation may modify the givenheaderandresponsein-place, or instantiate a new instances.- Parameters:
apiKey- key of the responseheader- response header.response- The body to handle.context- The context.- Returns:
- a non-null CompletionStage that, when complete, will yield a ResponseFilterResult containing the response to be forwarded.
- See Also:
-
onResponse
default CompletionStage<ResponseFilterResult> onResponse(org.apache.kafka.common.protocol.ApiKeys apiKey, short apiVersion, org.apache.kafka.common.message.ResponseHeaderData header, org.apache.kafka.common.protocol.ApiMessage response, FilterContext context) Handle the givenheaderandresponsepair, returning theheaderandresponsepair to be passed to the next filter using the ResponseFilterResult.
The implementation may modify the givenheaderandresponsein-place, or instantiate a new instances.- Parameters:
apiKey- key of the responseapiVersion- api version of the responseheader- response header.response- The body to handle.context- The context.- Returns:
- a non-null CompletionStage that, when complete, will yield a ResponseFilterResult containing the response to be forwarded.
- See Also:
-
onResponse(ApiKeys, short, ResponseHeaderData, ApiMessage, FilterContext)instead.