Package org.mockserver.model
Class GrpcBidiResponse
java.lang.Object
Response action for true bidirectional gRPC streaming. Expresses reactive bidi behaviour
declaratively, mirroring the WebSocket
HttpWebSocketResponse pattern (eager
messages + first-match rule list) adapted for gRPC.
Fields:
headers— initial response headers (sent with the :status 200 HEADERS frame)messages— EAGER server-push messages sent immediately after the initial HEADERS, regardless of inbound messages. Per-messageGrpcStreamMessage.getDelay()is honoured via event-loop scheduling: each message is written after its configured delay elapses, chained sequentially so ordering is preserved. The top-level actionAction.getDelay()(inherited fromAction) is applied before the initial HEADERS frame is written.rules— reactive rules: each inbound client message is matched against rules in order; the first rule whose matchJson matches emits its responsesstatusName,statusMessage— final grpc-status trailer (default OK/0)closeConnection— whether to close the connection after the trailing status
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mockserver.model.Action
Action.Direction, Action.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetRules()getType()static GrpcBidiResponseinthashCode()withCloseConnection(Boolean closeConnection) withHeader(String name, String... values) withHeader(Header header) withHeaders(Headers headers) withMessage(String json) withMessage(String json, Delay delay) withMessage(GrpcStreamMessage message) withMessages(List<GrpcStreamMessage> messages) withMessages(GrpcStreamMessage... messages) withRule(GrpcBidiRule rule) withRules(List<GrpcBidiRule> rules) withRules(GrpcBidiRule... rules) withStatusMessage(String statusMessage) withStatusName(String statusName) Methods inherited from class org.mockserver.model.Action
getDelay, getExpectationId, isPrimary, setExpectationId, withDelay, withDelay, withPrimaryMethods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
GrpcBidiResponse
public GrpcBidiResponse()
-
-
Method Details
-
grpcBidiResponse
-
withStatusName
-
getStatusName
-
withStatusMessage
-
getStatusMessage
-
withHeaders
-
withHeader
-
withHeader
-
getHeaders
-
withMessages
-
withMessages
-
withMessage
-
withMessage
-
withMessage
-
getMessages
-
withRules
-
withRules
-
withRule
-
getRules
-
withCloseConnection
-
getCloseConnection
-
getType
- Specified by:
getTypein classAction<GrpcBidiResponse>
-
equals
- Overrides:
equalsin classAction<GrpcBidiResponse>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAction<GrpcBidiResponse>
-