[infinispan-issues] [JBoss JIRA] (ISPN-11993) Allow automatic registration of Protobuf schemas and marshallers

Ryan Emerson (Jira) issues at jboss.org
Thu Jun 11 10:29:59 EDT 2020


     [ https://issues.redhat.com/browse/ISPN-11993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ryan Emerson updated ISPN-11993:
--------------------------------
    Description: 
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:


{code:java}
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));
{code}


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

# {{SerializationContextInitalizer}} services are automatically registerd if {{builder.autoAddAllContextInitializers()}} is configured.
# {{*.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.



  was:
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:


{code:java}
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));
{code}


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

# {{SerializationContextInitalizer}} services are automatically registerd if {{builder.autoAddAllContextInitializers()}} is configured.
# {{*.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.



> Allow automatic registration of Protobuf schemas and marshallers
> ----------------------------------------------------------------
>
>                 Key: ISPN-11993
>                 URL: https://issues.redhat.com/browse/ISPN-11993
>             Project: Infinispan
>          Issue Type: Feature Request
>          Components: Hot Rod, Marshalling
>    Affects Versions: 11.0.0.CR1
>            Reporter: Ryan Emerson
>            Assignee: Ryan Emerson
>            Priority: Major
>             Fix For: 12.0.0.Final
>
>
> 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:
> {code:java}
> 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));
> {code}
> Instead we should allow users to configure the client so that:
> # {{SerializationContextInitalizer}} services are automatically registerd if {{builder.autoAddAllContextInitializers()}} is configured.
> # {{*.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.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list