]
Tristan Tarrant updated ISPN-11993:
-----------------------------------
Fix Version/s: 12.1.0.Final
(was: 12.0.0.Final)
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.1.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.
NOTE: {{autoRegisterSchemas()}} will fail if authorization is enabled and the client does
not have the ___schema_manager role.