Skip to content

Commit

Permalink
docs(readme): add how to use Protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored and gklijs committed Nov 29, 2024
1 parent aa3e0b0 commit 018c81d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ titled [confluent Schema Registry and Rust](https://blog.openweb.nl/blog/conflue
recommended to look there for the newest and more elaborate documentation. It has a couple of feature flags, be sure to
set them correctly.

To use it to convert using avro async use:
### Avro

To use it to convert using Avro async use:

```toml
[dependencies]
Expand Down Expand Up @@ -64,6 +66,26 @@ depending on your use.
schema_registry_converter = { version = "4.2.0", features = ["avro", "blocking"] }
```

### Protobuf

To use it to convert using Protobuf async use:

```toml
[dependencies]
schema_registry_converter = { version = "4.2.0", features = ["proto_raw"] }
```

For simplicity there are `easy` variants that internally have an arc.
Making it easier to use at the price of some overhead. To use the `easy` variants add the `easy` feature and use the
structs that start with `Easy` in the name to do the conversions.

```toml
[dependencies]
schema_registry_converter = { version = "4.2.0", features = ["easy", "proto_raw"] }
```

...and see the [docs](https://docs.rs/schema_registry_converter) for how to use it.

## Consumer

For consuming messages encoded with the schema registry, you need to fetch the correct schema from the schema registry
Expand Down

0 comments on commit 018c81d

Please sign in to comment.