You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-hubs/schema-registry-client-side-enforcement.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,22 +7,32 @@ author: spelluru
7
7
ms.author: spelluru
8
8
---
9
9
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
12
11
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.
14
15
15
16
:::image type="content" source="./media/schema-registry-overview/information-flow.svg" alt-text="Image showing the Schema Registry information flow." border="false":::
16
17
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
+
17
22
### Producer
18
23
19
24
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.
22
29
23
30
### Consumer
24
31
25
32
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