vzhikserg commented on a change in pull request #4670: [doc] Add code samples 
for Protobuf and Avro schemas in java documentation
URL: https://github.com/apache/pulsar/pull/4670#discussion_r300158086
 
 

 ##########
 File path: site2/docs/client-libraries-java.md
 ##########
 @@ -602,6 +603,24 @@ The following schema formats are currently available for 
Java:
         .create();
   ```
 
+* Protobuf schemas can be generate using the `ProtobufSchema` class. The 
following example shows how to create the Protobuf schema and use it to 
instantiate a new producer:
+
+  ```java
+  Schema<MyProtobuf> protobufSchema = ProtobufSchema.of(MyProtobuf.class);
+  Producer<MyProtobuf> protobufProducer = client.newProducer(protobufSchema)
 
 Review comment:
   yes, I will change it. In my project the `Schema.PROTOBUF` form is used, but 
I wanted to keep it consistent with the sample for the JSON schema.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to