Package com.hsbc.cranker.mucranker
Interface ProxyInfo
-
public interface ProxyInfoInformation about a proxied request and response. UseCrankerRouterBuilder.withProxyListeners(List)to subscribe to events that exposes this data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longbytesReceived()longbytesSent()StringconnectorInstanceID()longdurationMillis()ThrowableerrorIfAny()If the response was not proxied successfully, then this has the exception.booleanisCatchAll()io.muserver.MuRequestrequest()io.muserver.MuResponseresponse()longresponseBodyFrames()Response bodies are sent from a connector to the router as a number of binary websocket frames.Stringroute()InetSocketAddressserviceAddress()longsocketWaitInMillis()
-
-
-
Method Detail
-
isCatchAll
boolean isCatchAll()
- Returns:
- Returns true if the connector is a catch-all connector (i.e. the router of the connector is '*').
-
connectorInstanceID
String connectorInstanceID()
- Returns:
- A unique ID for the service connector.
-
serviceAddress
InetSocketAddress serviceAddress()
- Returns:
- The address of the service connector that this request is being proxied to.
-
route
String route()
- Returns:
- The cranker route (i.e. the first part of a path) for the request, or '*' if a catch-all connector is used.
-
request
io.muserver.MuRequest request()
- Returns:
- The client's request to the router.
-
response
io.muserver.MuResponse response()
- Returns:
- The router's response to the client.
-
durationMillis
long durationMillis()
- Returns:
- The time in millis from when the router received the request until it sent the last response byte.
-
bytesReceived
long bytesReceived()
- Returns:
- The number of bytes uploaded by the client in the request
-
bytesSent
long bytesSent()
- Returns:
- The number of bytes sent to the client on the response
-
responseBodyFrames
long responseBodyFrames()
Response bodies are sent from a connector to the router as a number of binary websocket frames. This is a count of the number of frames received on this socket.This can be used to understand how target services are streaming responses to clients, especially if used in conjunction with
bytesSent()as it can give an idea of average response chunk size.- Returns:
- The number of chunks of binary data that the connector sent for this response
-
errorIfAny
Throwable errorIfAny()
If the response was not proxied successfully, then this has the exception.- Returns:
- null if no problems, otherwise an exception
-
socketWaitInMillis
long socketWaitInMillis()
- Returns:
- wait time in millis seconds to get a websocket (which is used for proxy requests)
-
-