Class ArmeriaMessageDeframer
java.lang.Object
com.linecorp.armeria.common.grpc.protocol.ArmeriaMessageDeframer
- All Implemented Interfaces:
HttpDecoder<DeframedMessage>
@UnstableApi
public class ArmeriaMessageDeframer
extends Object
implements HttpDecoder<DeframedMessage>
A deframer of messages transported in the gRPC wire format. See
gRPC Wire Format
for more detail on the protocol.
The logic has been mostly copied from io.grpc.internal.MessageDeframer
, while removing the buffer
abstraction in favor of using ByteBuf
directly, and allowing the delivery of uncompressed frames as
a ByteBuf
to optimize message parsing.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionArmeriaMessageDeframer(int maxMessageSizeBytes)
Construct anArmeriaMessageDeframer
for reading messages out of a gRPC request or response. -
Method Summary
Modifier and TypeMethodDescriptiondecompressor(@Nullable Decompressor decompressor)
Sets theDecompressor
for this deframer.void
process(HttpDecoderInput in, HttpDecoderOutput<DeframedMessage> out)
Decodes a stream ofHttpData
s to N objects.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linecorp.armeria.common.stream.HttpDecoder
processHeaders, processInformationalHeaders, processOnComplete, processOnError, processTrailers
-
Field Details
-
NO_MAX_INBOUND_MESSAGE_SIZE
public static final int NO_MAX_INBOUND_MESSAGE_SIZE- See Also:
- Constant Field Values
-
-
Constructor Details
-
ArmeriaMessageDeframer
public ArmeriaMessageDeframer(int maxMessageSizeBytes)Construct anArmeriaMessageDeframer
for reading messages out of a gRPC request or response.
-
-
Method Details
-
process
Description copied from interface:HttpDecoder
Decodes a stream ofHttpData
s to N objects. This method will be called whenever anHttpData
is signaled fromPublisher
.- Specified by:
process
in interfaceHttpDecoder<DeframedMessage>
- Throws:
Exception
-
decompressor
Sets theDecompressor
for this deframer.
-