Class 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.

    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProtobufFieldPartitioner

        public ProtobufFieldPartitioner()
    • Method Detail

      • partition

        public static <M extends com.google.protobuf.Message> java.util.Collection<M> partition​(M msg,
                                                                                                com.google.protobuf.Descriptors.FieldDescriptor repeatedField,
                                                                                                long maxMsgSizeInBytes)