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
description: This article provides information on using schemas in a schema registry when publishing or consuming events from Azure Event Hubs.
4
4
ms.topic: conceptual
5
5
ms.date: 04/26/2023
@@ -9,30 +9,32 @@ ms.author: spelluru
9
9
10
10
# Client-side schema enforcement
11
11
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).
12
+
Client-side schema enforcement ensures that data is validated against schemas defined in the schema registry on the client side rather than the broker/server side. The producer application can use schemas to validate and serialize data before sending the data to an event hub. Similarly, a consumer application can deserialize and validate data after it receives events from an event hub.
13
13
14
-
This flow is illustrated as shown -
14
+
Client-side schema enforcement ensures that data is validated on the client side. The producer application sends the data, and the consumer application receives it. That data is validated against schemas defined in the schema registry on the client side rather than the broker/server side.
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
+
This diagram illustrates the flow:
17
+
18
+
:::image type="content" source="./media/schema-registry-overview/information-flow.svg" alt-text="Diagram that shows the schema registry information flow." border="false":::
17
19
18
20
> [!NOTE]
19
-
> While the 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.
21
+
> The diagram showcases the information flow when event producers and consumers use a schema registry with the Kafka protocol and Avro schema. Other protocols and schema formats work in a similar way.
20
22
>
21
23
22
-
### Producer
24
+
### Producer
23
25
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.
26
+
1.The Kafka producer application uses `KafkaAvroSerializer` to serialize event data by using the specified schema. The producer application provides details of the schema registry endpoint and other optional parameters that are required for schema validation.
25
27
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.
28
+
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 automatically register the schema with the schema registry if it doesn't exist.
27
29
28
-
3. Then the serializer prepends the schema ID to the serialized data that is published to the Event Hubs.
30
+
1. The serializer prepends the schema ID to the serialized data that's published to the event hub.
29
31
30
-
### Consumer
32
+
### Consumer
31
33
32
-
1. Kafka consumer application uses `KafkaAvroDeserializer` to deserialize data that it receives from the event hub.
34
+
1.The Kafka consumer application uses `KafkaAvroDeserializer` to deserialize data that it receives from the event hub.
33
35
34
-
2. The deserializer uses the schema ID (prepended by the producer) to retrieve schema from the schema registry.
36
+
1. The deserializer uses the schema ID (prepended by the producer) to retrieve the schema from the schema registry.
35
37
36
-
3. The deserializer uses the schema to deserialize event data that it receives from the event hub.
38
+
1. The deserializer uses the schema to deserialize event data that it receives from the event hub.
37
39
38
-
4. The schema registry client uses caching to prevent redundant schema registry lookups in the future.
40
+
1. The schema registry client uses caching to prevent redundant schema registry lookups in the future.
0 commit comments