Skip to content

Commit

Permalink
[Doc] Add schema examples for Java client (apache#11420)
Browse files Browse the repository at this point in the history
* [Doc] Add schema examples for Java client

* update

Co-authored-by: Anonymitaet <anonymitaet_hotmail.com>
  • Loading branch information
Anonymitaet authored Jul 23, 2021
1 parent 540ae1b commit 69704d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion site2/docs/client-libraries-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ Producer<byte[]> producer = client.newProducer()
The producer above is equivalent to a `Producer<byte[]>` (in fact, you should *always* explicitly specify the type). If you'd like to use a producer for a different type of data, you'll need to specify a **schema** that informs Pulsar which data type will be transmitted over the [topic](reference-terminology.md#topic).
### Schema example
### AvroBaseStructSchema example
Let's say that you have a `SensorReading` class that you'd like to transmit over a Pulsar topic:
Expand Down Expand Up @@ -817,6 +817,10 @@ The following schema formats are currently available for Java:
.create();
```
### ProtobufNativeSchema example
For example of ProtobufNativeSchema, see [`SchemaDefinition` in `Complex type`](schema-understand.md#complex-type).
## Authentication
Pulsar currently supports three authentication schemes: [TLS](security-tls-authentication.md), [Athenz](security-athenz.md), and [Oauth2](security-oauth2.md). You can use the Pulsar Java client with all of them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ Producer<byte[]> producer = client.newProducer()
The producer above is equivalent to a `Producer<byte[]>` (in fact, you should *always* explicitly specify the type). If you'd like to use a producer for a different type of data, you'll need to specify a **schema** that informs Pulsar which data type will be transmitted over the [topic](reference-terminology.md#topic).
### Schema example
### AvroBaseStructSchema example
Let's say that you have a `SensorReading` class that you'd like to transmit over a Pulsar topic:
Expand Down Expand Up @@ -816,6 +816,10 @@ The following schema formats are currently available for Java:
.create();
```
### ProtobufNativeSchema example
For example of ProtobufNativeSchema, see [`SchemaDefinition` in `Complex type`](schema-understand.md#complex-type).
## Authentication
Pulsar currently supports three authentication schemes: [TLS](security-tls-authentication.md), [Athenz](security-athenz.md), and [Oauth2](security-oauth2.md). You can use the Pulsar Java client with all of them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ Producer<byte[]> producer = client.newProducer()
The producer above is equivalent to a `Producer<byte[]>` (in fact, you should *always* explicitly specify the type). If you'd like to use a producer for a different type of data, you'll need to specify a **schema** that informs Pulsar which data type will be transmitted over the [topic](reference-terminology.md#topic).
### Schema example
### AvroBaseStructSchema example
Let's say that you have a `SensorReading` class that you'd like to transmit over a Pulsar topic:
Expand Down Expand Up @@ -819,6 +819,10 @@ The following schema formats are currently available for Java:
.create();
```
### ProtobufNativeSchema example
For example of ProtobufNativeSchema, see [`SchemaDefinition` in `Complex type`](schema-understand.md#complex-type).
## Authentication
Pulsar currently supports three authentication schemes: [TLS](security-tls-authentication.md), [Athenz](security-athenz.md), and [Oauth2](security-oauth2.md). You can use the Pulsar Java client with all of them.
Expand Down

0 comments on commit 69704d2

Please sign in to comment.