Package io.kroxylicious.proxy.filter
Interface ProduceRequestFilter
- All Superinterfaces:
Filter
A stateless filter for ProduceRequests.
-
Method Summary
Modifier and TypeMethodDescriptiononProduceRequest(short apiVersion, org.apache.kafka.common.message.RequestHeaderData header, org.apache.kafka.common.message.ProduceRequestData request, FilterContext context) Handle the givenheaderandrequestpair, returning theheaderandrequestpair to be passed to the next filter using the RequestFilterResult.default booleanshouldHandleProduceRequest(short apiVersion) Determine if a request message of type ProduceRequest should be handled by this filter implementation.
-
Method Details
-
shouldHandleProduceRequest
default boolean shouldHandleProduceRequest(short apiVersion) Determine if a request message of type ProduceRequest should be handled by this filter implementation. returns true thenonProduceRequestis eligible to be invoked with deserialized data, if the message reaches this filter in the chain.- Parameters:
apiVersion- the apiVersion of the message- Returns:
- true if it should be handled
-
onProduceRequest
CompletionStage<RequestFilterResult> onProduceRequest(short apiVersion, org.apache.kafka.common.message.RequestHeaderData header, org.apache.kafka.common.message.ProduceRequestData request, FilterContext context) Handle the givenheaderandrequestpair, returning theheaderandrequestpair to be passed to the next filter using the RequestFilterResult.
The implementation may modify the givenheaderandrequestin-place, or instantiate a new instances.- Parameters:
apiVersion- the apiVersion of the requestheader- request header.request- The body to handle.context- The context.- Returns:
- a non-null CompletionStage that, when complete, will yield a RequestFilterResult containing the request to be forwarded.
- See Also:
-