Skip to content

[FEATURE REQ] Provide a easy way to use Azure Schema Registry in Spring Cloud Azure #41041

Open
@rujche

Description

@rujche

Is your feature request related to a problem? Please describe.
In this sample: Use Azure Schema Registry in Spring Boot Application, Using Azure Schema Registry only need to configure a Kafka Serializer or Kafka Deserializer. But when customer use Event Hub or Service Bus without Kafka protocal, it's not easy to use Azure Schema Registry.

Describe the solution you'd like
Provide a feature to help customer easily use Azure Schema Registry with Event Hub or Service Bus without using Kafka protocal.

Describe alternatives you've considered
If use sdk, customer can do serialize and deserizlize by themself. Example code:

List<EventData> serializedCards = playingCards.stream()
.map(card -> {
return serializer.serialize(card, TypeReference.createInstance(EventData.class));
})
.collect(Collectors.toList());
// Publish the events
producerClient.send(serializedCards, sendOptions);

But for Spring Cloud Azure users, it's not easy to achieve this.

Additional context
In above sample, the schema validation is done in kafka client. Here is a screenshot about using serializer:
image

But in this repository, schema validation can NOT be done in sdk level, because the sdk level not have information of schema, you can refer to related code to confirm that. But it can be done in Spring Cloud Azure level.

In Spring Cloud Azure, every place use sdk to send/receive message using Event Hub or Service Bus can be a candidate to enhance. Here is a sample analyze of service bus:

graph
    ServiceBusTemplate:::task --> ServiceBusSenderAsyncClient:::sdk
    ServiceBusListener --> ServiceBusListenerAnnotationBeanPostProcessor
    ServiceBusListenerAnnotationBeanPostProcessor --> AzureListenerAnnotationBeanPostProcessorAdapter
    AzureListenerAnnotationBeanPostProcessorAdapter --> AzureListenerEndpointRegistrar
    AzureListenerEndpointRegistrar --> AzureListenerEndpointRegistry
    AzureListenerEndpointRegistry --> ServiceBusMessageListenerContainerFactory
    ServiceBusMessageListenerContainerFactory --> ServiceBusMessageListenerContainer
    ServiceBusMessageListenerContainer --> ServiceBusProcessorFactory
    ServiceBusProcessorFactory --> ServiceBusProcessorClient:::sdk
    ServiceBusMessageListenerContainer:::task --> ServiceBusProcessorClient:::sdk
    ServiceBusProcessorClientLifecycleManager --> ServiceBusProcessorClient:::sdk
    AzureServiceBusProcessorClientConfiguration --> ServiceBusProcessorClient:::sdk
    DefaultServiceBusNamespaceProcessorFactory --> ServiceBusProcessorClient:::sdk
    
classDef sdk fill:red
classDef task fill:green
Loading

Items with green background color is a potential enhance point.
Need more investigation and analyzation before implement this function.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesazure-spring-eventhubsSpring event hubs related issues.azure-spring-servicebusSpring service bus related issues.

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions