Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3907

Define a Protobuf annotation for defining numeric IDs for types

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 7.1.0.Final
    • 6.0.0.Final
    • Embedded Querying
    • None

    Description

      Currently the wire format of all Protobuf encoded keys and values contains a header/envelope that has some metadata information, like the fully qualified type name (that is protobuf type name, not java) of the object encoded in the message. This information is needed so that the other end can decode the message. And we added it because the Protobuf spec assumes both ends are aware of the message type, which is not the case most of the time.

      While this approach solves the problem nicely, it becomes very inefficient is the FQN is long, which is usually the case, as people tend to stick the domain name of their company + package app name into it.

      Solution: provide alternative unique numeric IDs to all types. The IDs can be added to message type definitions in the protobuf schema and the user is in charge of guaranteeing their uniqueness while the system must check and enforce the uniqueness when a schema is registered ib the ProtobufMetadataManager. To do this we define a custom Protobuf Message type option that accepts a numeric value. If such a numeric ID was assigned to the type then when it is serialized in protobuf the system has to use this id in the header rather that the FQN string.

      This option should not be mandatory. Existing apps should work without requiring source code changes or recompiling providing that the relevant jars are upgraded in both client and server to support the new header encoding.

      Attachments

        Activity

          People

            anistor Adrian Nistor (Inactive)
            anistor Adrian Nistor (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: