Interface KafkaExecutionContext
- All Superinterfaces:
BaseExecutionContext,NativeExecutionContext
Execution context specialized for Kafka.
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
-
Field Summary
FieldsFields inherited from interface io.gravitee.gateway.reactive.api.context.base.BaseExecutionContext
TEMPLATE_ATTRIBUTE_CONTEXT -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionOnResponse(Function<KafkaExecutionContext, io.reactivex.rxjava3.core.Completable> onResponseCallback) Allows defining an action in the request phase to be executed at the response phase.org.apache.kafka.common.protocol.ApiKeysapiKey()Access the connection context.intio.reactivex.rxjava3.core.CompletableinterruptWith(org.apache.kafka.common.protocol.Errors errors) Interrupts the current execution while indicating that the response can be sent "as is" to the downstream.<T extends org.apache.kafka.common.requests.AbstractResponse>
io.reactivex.rxjava3.core.CompletableinterruptWith(T response) Interrupts the current execution while indicating that the response can be sent "as is" to the downstream.Access the network controller of the current execution context.org.apache.kafka.common.security.auth.KafkaPrincipalAccess the principal of the current execution context.request()response()Methods inherited from interface io.gravitee.gateway.reactive.api.context.base.BaseExecutionContext
getAttribute, getAttributeAsList, getAttributeNames, getAttributes, getComponent, getInternalAttribute, getInternalAttributes, getTemplateEngine, getTracer, localAddress, putAttribute, putInternalAttribute, remoteAddress, removeAttribute, removeInternalAttribute, setAttribute, setInternalAttribute, timestamp, tlsSession, warnWith
-
Field Details
-
TEMPLATE_ATTRIBUTE_REQUEST
- See Also:
-
TEMPLATE_ATTRIBUTE_RESPONSE
- See Also:
-
-
Method Details
-
apiKey
org.apache.kafka.common.protocol.ApiKeys apiKey() -
correlationId
int correlationId() -
request
KafkaRequest request() -
response
KafkaResponse response() -
connectionContext
KafkaConnectionContext connectionContext()Access the connection context.- Returns:
- the connection context.
-
principal
org.apache.kafka.common.security.auth.KafkaPrincipal principal()Access the principal of the current execution context.- Returns:
- the principal of the current execution context.
-
networkController
NetworkController networkController()Access the network controller of the current execution context.- Returns:
- the network controller of the current execution context.
-
addActionOnResponse
void addActionOnResponse(Function<KafkaExecutionContext, io.reactivex.rxjava3.core.Completable> onResponseCallback) Allows defining an action in the request phase to be executed at the response phase.- Parameters:
onResponseCallback- the action to be executed at the response phase.
-
interruptWith
io.reactivex.rxjava3.core.Completable interruptWith(org.apache.kafka.common.protocol.Errors errors) Interrupts the current execution while indicating that the response can be sent "as is" to the downstream.- Parameters:
errors- theErrorsto interrupt the chain and create a response with.
-
interruptWith
<T extends org.apache.kafka.common.requests.AbstractResponse> io.reactivex.rxjava3.core.Completable interruptWith(T response) Interrupts the current execution while indicating that the response can be sent "as is" to the downstream.- Parameters:
response- theAbstractResponseto interrupt the chain with.
-