Skip to content

Commit 0eefe75

Browse files
committed
cleaning up the client side schema enforcement doc
1 parent 535b582 commit 0eefe75

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

articles/event-hubs/schema-registry-client-side-enforcement.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,32 @@ author: spelluru
77
ms.author: spelluru
88
---
99

10-
# Client-side schema enforcement
11-
The information flow when you use schema registry is the same for all protocols that you use to publish or consume events from Azure Event Hubs.
10+
# Client-side schema enforcement
1211

13-
The following diagram shows how the information flows when event producers and consumers use Schema Registry with the **Kafka** protocol using **Avro** serialization.
12+
Client-side schema enforcement ensures that the data sent by the producer application and received by the consumer application is validated against the schemas defined in the Schema Registry on the client side itself (that is, rather than on the broker/server side).
13+
14+
This is illustrated in the diagram below.
1415

1516
:::image type="content" source="./media/schema-registry-overview/information-flow.svg" alt-text="Image showing the Schema Registry information flow." border="false":::
1617

18+
> [!NOTE]
19+
> While the above diagram showcases the information flow when event producers and consumers use Schema Registry with the **Kafka** protocol and **Avro** schema, it doesn't really change for other protocols and schema formats.
20+
>
21+
1722
### Producer
1823

1924
1. Kafka producer application uses `KafkaAvroSerializer` to serialize event data using the specified schema. Producer application provides details of the schema registry endpoint and other optional parameters that are required for schema validation.
20-
1. The serializer looks for the schema in the schema registry to serialize event data. If it finds the schema, then the corresponding schema ID is returned. You can configure the producer application to auto register the schema with the schema registry if it doesn't exist.
21-
1. Then the serializer prepends the schema ID to the serialized data that is published to the Event Hubs.
25+
26+
2. The serializer looks for the schema in the schema registry to serialize event data. If it finds the schema, then the corresponding schema ID is returned. You can configure the producer application to auto register the schema with the schema registry if it doesn't exist.
27+
28+
3. Then the serializer prepends the schema ID to the serialized data that is published to the Event Hubs.
2229

2330
### Consumer
2431

2532
1. Kafka consumer application uses `KafkaAvroDeserializer` to deserialize data that it receives from the event hub.
26-
1. The deserializer uses the schema ID (prepended by the producer) to retrieve schema from the schema registry.
27-
1. The deserializer uses the schema to deserialize event data that it receives from the event hub.
28-
1. The schema registry client uses caching to prevent redundant schema registry lookups in the future.
33+
34+
2. The deserializer uses the schema ID (prepended by the producer) to retrieve schema from the schema registry.
35+
36+
3. The deserializer uses the schema to deserialize event data that it receives from the event hub.
37+
38+
4. The schema registry client uses caching to prevent redundant schema registry lookups in the future.

0 commit comments

Comments
 (0)