public interface RequestIdProvider extends RequestIdGenerator
ContextsContainer are specific to a request and in order to uniquiely identify a request
we require an identifier. This interface defines the contract to provide a globally unique identifier for a request.| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
beforeClientRequest(io.netty.util.AttributeMap clientAttributeMap)
This does the correlation between an inbound request and all outbound requests that are made during the
processing of the same request.
|
java.lang.String |
beforeServerResponse(ContextKeySupplier responseKeySupplier,
io.netty.util.AttributeMap channelAttributeMap)
This is primarily for response-request correlation for protocols that support multiple requests on the same
connection, eg: using HTTP pipelining.
|
java.lang.String |
getRequestIdContextKeyName()
Name of the context key (to be obtained via
ContextKeySupplier) that is to be used to transfer the
request identifier from one machine to another. |
java.lang.String |
onClientResponse(io.netty.util.AttributeMap clientAttributeMap)
Specifies the request id to be used while receiving a response for a client.
|
java.lang.String |
onServerRequest(ContextKeySupplier keySupplier,
io.netty.util.AttributeMap channelAttributeMap)
Inspects the
keySupplier or context to see if there is a request Id already defined for this
request. |
newRequestIdjava.lang.String onServerRequest(ContextKeySupplier keySupplier, io.netty.util.AttributeMap channelAttributeMap)
keySupplier or context to see if there is a request Id already defined for this
request. If it is, then it returns the same, else returns null
* This method is NOT idempotentkeySupplier - The key supplier where usually an externally defined request Id is present.channelAttributeMap - Channel attribute map, normally obtained as ChannelHandlerContext.channel()null if none exists.java.lang.String beforeServerResponse(ContextKeySupplier responseKeySupplier, io.netty.util.AttributeMap channelAttributeMap)
responseKeySupplier - ContextKeySupplier for the response.channelAttributeMap - Channel attribute map, normally obtained as ChannelHandlerContext.channel()null otherwise.java.lang.String beforeClientRequest(io.netty.util.AttributeMap clientAttributeMap)
clientAttributeMap - Client's channel attribute map, normally obtained as
ChannelHandlerContext.channel()null otherwise.java.lang.String onClientResponse(io.netty.util.AttributeMap clientAttributeMap)
clientAttributeMap - Client's channel attribute map, normally obtained as
ChannelHandlerContext.channel()null otherwise.java.lang.String getRequestIdContextKeyName()
ContextKeySupplier) that is to be used to transfer the
request identifier from one machine to another.