public final class HttpContextKeys
extends Object
ContextMap.Key(s) defined for HTTP.| Modifier and Type | Field and Description |
|---|---|
static ContextMap.Key<HttpExecutionStrategy> |
HTTP_EXECUTION_STRATEGY_KEY
Allows using a custom
HttpExecutionStrategy for the HTTP message execution, when present in the meta-data
context. |
static ContextMap.Key<Boolean> |
HTTP_FORCE_NEW_CONNECTION
If set to true, forces creating a new connection versus potentially selecting an already established one.
|
static ContextMap.Key<String> |
HTTP_ROUTE
The key used by server-side routers to assign an
http.route
attribute for incoming requests.
|
static ContextMap.Key<Object> |
HTTP_TARGET_ADDRESS_BEHIND_PROXY
Deprecated.
Use
TransportObserverConnectionFactoryFilter to configure TransportObserver and then
listen ConnectionObserver.onProxyConnect(Object) callback to distinguish between a regular connection and
a connection to the secure HTTP proxy tunnel. For clear text HTTP proxies, consider installing a custom client
filter that will populate HttpMetaData.context() with a similar key or reach out to the
ServiceTalk developers to discuss ideas. |
static ContextMap.Key<Long> |
STREAM_ID
The key used to retrieve a virtual stream identifier from the corresponding
request context. |
public static final ContextMap.Key<HttpExecutionStrategy> HTTP_EXECUTION_STRATEGY_KEY
HttpExecutionStrategy for the HTTP message execution, when present in the meta-data
context. Otherwise, an automatically inferred strategy will be used by a client
or server.@Deprecated public static final ContextMap.Key<Object> HTTP_TARGET_ADDRESS_BEHIND_PROXY
TransportObserverConnectionFactoryFilter to configure TransportObserver and then
listen ConnectionObserver.onProxyConnect(Object) callback to distinguish between a regular connection and
a connection to the secure HTTP proxy tunnel. For clear text HTTP proxies, consider installing a custom client
filter that will populate HttpMetaData.context() with a similar key or reach out to the
ServiceTalk developers to discuss ideas.
To distinguish between a
secure
HTTP proxy tunneling and a clear text HTTP proxy, check presence of ConnectionInfo.sslConfig().
public static final ContextMap.Key<Boolean> HTTP_FORCE_NEW_CONNECTION
This key is only available when reserving a connection and will be ignored when performing a regular
request on the client (for example through HttpRequester.request(HttpRequest)).
public static final ContextMap.Key<String> HTTP_ROUTE
Router implementation are responsible for assigning this key to either HttpMetaData.context()
(preferred) or AsyncContext if HttpRequestMetaData is not available in the scope of the router.
This key can be used later by observability extensions to assign an attribute for emitted metrics or traces.
public static final ContextMap.Key<Long> STREAM_ID
request context.
Multiplexed protocols, like HTTP/2, use streams to precess every request. The Stream ID is lazy and typically assigned after the request headers are written to the transport. Therefore, it can not be known in advance on the client-side, but often useful to retrieve later for correlation with other events.