protobufRequestFilter is the precise selector for inbound protobuf traffic in a Fluxzy rule. Combine it with the request side actions you already use for JSON or form encoded uploads to extend the same observability and shaping workflow to binary clients.
Use protobufRequestFilter when you want a rule that fires only because the client is sending protobuf, irrespective of what the server returns. This is the right filter when you intend to inspect, log or mutate the upload side of an API.
Typical situations:
The filter evaluates on the requestBodyReceivedFromClient scope, so the upload Content-Type has already been read by the proxy when it runs. If you also care about responses use protobufFilter, or protobufResponseFilter for the opposite direction only.
Add a tag to any exchange where the client is sending protobuf so you can pivot the timeline by inbound encoding.
rules:
- filter:
typeKind: ProtobufRequestFilter
actions:
- typeKind: ApplyTagAction
tag:
value: protobuf-upload
Restrict the bandwidth of any request that carries a protobuf body so you can reproduce timeouts on the server side.
rules:
- filter:
typeKind: ProtobufRequestFilter
actions:
- typeKind: AverageThrottleAction
bandwidthBytesPerSeconds: 16384
Send protobuf uploads to a dedicated capture so the binary payloads can be replayed later against a known .proto schema.
rules:
- filter:
typeKind: ProtobufRequestFilter
actions:
- typeKind: CaptureSessionAction
Select requests sending a protobuf body. Filtering is made by inspecting value of Content-Type header.
Evaluation scope defines the timing where this filter will be applied.
requestBodyReceivedFromClient This scope occurs the moment fluxzy received fully the request body from the client. In a fullstreaming mode which is the default mode, this event occurs when the full body is already fully sent to the remote server.
protobufRequestFilter
This filter has no specific characteristic
The following table describes the customizable properties available for this filter:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| inverted | boolean | Negate the filter result | false |
The following examples apply a comment to the filtered exchange
Select only exchanges with protobuf request body.
rules:
- filter:
typeKind: ProtobufRequestFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
Select exchanges without protobuf request body.
rules:
- filter:
typeKind: ProtobufRequestFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of ProtobufRequestFilter for .NET integration.
This filter has no related filter
protobufRequestFilter only inspects the request Content-Type, while protobufFilter matches when either the request or the response is protobuf. Use the request filter when you only want to act on the upload side.
Yes. gRPC uses application/grpc, which is a protobuf media type, so client streaming and unary gRPC requests are matched too.
It evaluates on the requestBodyReceivedFromClient scope, after the proxy has finished reading the request body from the client. This is the right moment to act on the upload.
Yes, set inverted: true to select every exchange whose request body is not protobuf.