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

Allow automatic registration of Protobuf schemas and marshallers

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Obsolete
    • Icon: Major Major
    • 12.1.2.Final
    • 11.0.0.Final
    • Hot Rod, Marshalling
    • None

      Currently it's necessary for users to automatically add SerializationContextIntializer instances to the client via addContextInitializers and for .proto files to be registered like so:

      Path proto = Paths.get(Query.class.getClassLoader().getResource("proto/sheep.proto").toURI());
      cacheManager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME).put("sheep.proto", Files.readString(proto));
      

      Instead we should allow users to configure the client so that:

      1. SerializationContextInitalizer services are automatically registerd if builder.autoAddAllContextInitializers() is configured.
      2. *.proto files on the classpath and in available SerializationContextInitializers are automatically registered with the server if .autoRegisterSchemas() is configured.

      ProtoStreams AutoProtoSchemaBuilder already provides a `service` attribute to generate the service files for SerializationContextInitiailizer, however this is false by default. We should update this to true so that users have one less knob to confgure.

      NOTE: autoRegisterSchemas() will fail if authorization is enabled and the client does not have the ___schema_manager role.

              remerson@redhat.com Ryan Emerson
              remerson@redhat.com Ryan Emerson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: