You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/08/27 23:16:28 UTC

[GitHub] [pulsar] sijie commented on issue #5056: [pulsar-client] auto produce support message with schema version

sijie commented on issue #5056: [pulsar-client] auto produce support message with schema version
URL: https://github.com/apache/pulsar/pull/5056#issuecomment-525519313
 
 
   @yittg I think it is in a good direction. But I have a different thought about the interface. Technically producers shouldn't be aware of and care about the schema version when it produces a message. It should just use different schemas to send the messages and Pulsar clients should handle all the remaining logic.
   
   The interface that I would be proposing is:
   
   ```
   <V> TypedMessageBuilder<V> newMessage(Schema<V> schema);
   ```
   
   - it hides the schema version details from end-user
   - it allows applications to produce different POJOs using same producer.
   
   In the implementation, Producer should maintain a map between schema and the schema version. If the schema is already registered, producer is able to find the schema version and attach the schema version when sending out the message. If the schema is not registered, it will register the schema and get the schema version. So any subsequent produce requests using that schema can use the right schema version. 
   
   This may require adding a new command in Pulsar wire protocol for registering a new schema.
   
   ---
   
   In any case, since this feature requires changing/adding public interface and (potentially) modify the wire protocol, can you write a PIP and start an email thread for discussing this PIP at dev@pulsar.apache.org ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services