Intergrate Azure Schema Registry with Azure Service Bus

suvra jyoti 156 Reputation points
2024-11-04T14:34:47.9733333+00:00

In the documentation it is mentioned that "In spite of being hosted in Azure Event Hubs, the schema registry can be used universally with all Azure messaging services and any other message or events broker". I believe that then with Azure Service Bus also, we can use the Azure Schema Registry so that any message sent to the Service Bus by a producer is validated against a Schema registered in Schema Registry. Is there any difference between the two i.e. using Azure Schema Registry with Azure Service Bus vs using Azure Schema Registry with Event Hub w.r.t to the capabilities that can be achieved? Please also refer to some documentation of how to integrate Azure Service Bus and Azure Schema Registry.

Thanks

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
653 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
663 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Khadeer Ali 1,400 Reputation points Microsoft Vendor
    2024-11-06T02:42:50.6233333+00:00

    Hi suvra jyoti,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    You’re correct that the Azure Schema Registry can be used with both Azure Service Bus and Azure Event Hubs. The primary difference lies in how each service handles schema validation and the specific use cases they cater to.

    When using Azure Schema Registry with Azure Event Hubs, the integration is seamless and built-in, allowing automatic schema validation for messages. In contrast, with Azure Service Bus, you need to implement additional code to validate messages against the schema, as it doesn’t have native integration with the Schema Registry. This means that while Event Hubs handles schema validation automatically, Service Bus requires manual validation through custom logic.

    For integrating Azure Schema Registry with Azure Service Bus, you can refer to the following resources:

    https://github.com/aliencube/AzureMessaging.SchemaRegistry/blob/dev/docs/schema-validation-service-bus.md

    https://learn.microsoft.com/en-us/azure/event-hubs/schema-registry-concepts

    In Azure Service Bus, you need to manually add a reference to the schema in the message and use custom code to validate it against the schema before sending or after receiving. In contrast, Azure Event Hubs automatically associates schemas with event hubs or Kafka topics, and messages are validated against the schema as part of the event streaming process.

    If you find this answer helpful, please click "Accept Answer" and kindly upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.