merlimat 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_r300159463
##########
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:
Oh, I see. Do you mind also changing the example for JSON?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services