Class ProtobufFieldPartitioner
- java.lang.Object
-
- com.github.chrisgleissner.jutil.protobuf.ProtobufFieldPartitioner
-
public class ProtobufFieldPartitioner extends java.lang.Object
Splits a large Protobuf message into multiple messages by equally distributing the contents of one of its fields across newly created instances. All fields other than the distributed field remain as per the original Protobuf message.One use case of this class is for sending a Protobuf message across a network where hard size limits per message are in place, for example when using Azure Service Bus and its 256KB size limit.
-
-
Constructor Summary
Constructors Constructor Description ProtobufFieldPartitioner()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <M extends com.google.protobuf.Message>
java.util.Collection<M>partition(M msg, com.google.protobuf.Descriptors.FieldDescriptor repeatedField, long maxMsgSizeInBytes)
-