Skip to content

Spring Cloud Azure Messaging Design

Xiaolu Dai edited this page Nov 11, 2022 · 1 revision

Overview

In Spring Cloud Azure 4.0 we are going to reorganize Spring Cloud Azure Messaging projects to follow Spring abstraction of messaging projects, in order to make our projects easy to be integrated with more features of Spring abstraction.

Problems

  1. Flat and over-aggregated project structure.
    • All fundamental classes are placed in azure-spring-integration-core neglecting their internal hierarchical relationships.
    • Customers cannot follow Spring abstraction to use associated APIs from current Spring Cloud Azure Messaging modules.
  2. Unreasonable dependency relationships violating Spring conventions.
    • azure-spring-cloud-messaging depends on azure-spring-integration-core, which is incorrect and is confusing to users.

Goals

Make the structure of Spring Cloud Azure Messaging projects follow Spring conventions, to be specific:

  1. Spring Cloud Azure Messaging projects should have similar sub-modules aligned to Spring, including Spring Messaging, Spring Integration and Spring Cloud Stream.
  2. The dependency relationships of Spring Cloud Azure Messaging projects should be aligned with Spring convention.
  3. The way current classes being organized should follow associated Spring projects.

Dependency relationship maps in this doc.

  1. Explanation of line type.
  2. The dependency is not fixed all the time, it's OK to add new dependencies when developing related module. The new added dependency should follow the design rule.

Project Structure analysis

The current project structure of Spring Cloud Azure Messaging is not ideal and needs reorganization. To achieve the above goals, we analyze the projects of Spring Kafka, Spring Integration support of Apache Kafka and Spring Cloud Stream support of Apache Kafka, and thus design the structure for Spring Cloud Azure Messaging of Event Hubs, Service Bus and Storage Queue.

Spring support for Azure Event Hubs

The project of Spring Cloud Azure Messaging for Event Hubs is expected to follow the convention of Spring support for Kafka. Thus the project structure is designed as below:

mermaid-diagram-20211013135354

Edit: Spring support Event Hubs

Spring support for Azure Service Bus

This project covers two sub projects, one is to provide spring support for native Service Bus service, the other is to support Service Bus from JMS API.

Spring support for native Service Bus

The project of Spring Cloud Azure Messaging for Service Bus is expected to follow the convention of Spring support for Kafka. Thus the project structure is designed as below:

mermaid-diagram-20211013135242

Edit: Spring support Service Bus

Spring JMS support for Service Bus

This project is aimed to provide Spring JMS support to interact with Service Bus with JMS API. The project structure is designed as below:

mermaid-diagram-20211013140431

Edit: Spring JMS support Service Bus

Spring support for Azure Storage Queue

The current project of Spring Cloud Azure Messaging for Storage Queue only involves the integration of Spring Messaging and Spring Integration, the structure is designed as below:

mermaid-diagram-20211013140153

Edit: Spring support Storage Queue

Note: we need further investigation on whether it can support Spring Cloud Stream.

Module introduction

With reference of Spring support for Apache Kafka, we reorganize the structure of Spring Cloud Azure Messaging modules to meet the goal of 4.0. Modules include spring messaging azure, spring integration azure and spring cloud azure stream binder.

Azure support for Spring Messaging

This project covers three Azure services: Azure Event Hubs, Azure Service Bus and Azure Storage Queue. For each service, the Azure support for Spring Messaging should contain two modules: a core module implements Spring Messaging abstraction and common utils applied with all Azure Messaging services, the other module implements customization with each service and client factories.

Spring Messaging Azure

The module is based on spring-messaging and should provide the following components:

  • Message Converter to transfer between Spring message and service message
  • Message header
  • Exception of message handling
  • Checkpointer to abstract the check point behavior of different Azure services

Spring Messaging for Azure services

We should have three sub modules as

  • spring-messaging-azure-eventhubs
  • spring-messaging-azure-servicebus
  • spring-messaging-azure-storage-queue

On the basis of spring-messaging-azure components, the above modules should also contains the following components:

  • Client Factory to build clients
  • Operation to perform different message publishing and receiving operation

Azure support for Spring Integration

This project covers three Azure services: Azure Event Hubs, Azure Service Bus and Azure Storage Queue. For each service, the Azure support for Spring Integration should contain two modules: a core module implements basic Spring Integration abstraction and the other module implements customization with each service.

Spring Integration Azure Core

The module is based on spring-integration-core and should provide the following components:

  • Inbound Channel Adapter to receive messages from the broker
  • Message Handler to publish messages from the broker

Azure Spring Integration for services

We should have three sub modules as

  • spring-integration-azure-eventhubs
  • spring-integration-azure-servicebus
  • spring-integration-azure-storage-queue

Azure support for Spring Cloud Stream Binder

This project covers two Azure services: Azure Event Hubs and Azure Service Bus. For each service, the Azure support for Spring Cloud Stream should contain two modules: a core module containing configuration properties and a binder module for SCS abstraction, health indicator and autoconfiguration.

Spring Cloud Azure Stream Binder Core

We should have two modules as

  • spring-cloud-azure-stream-binder-eventhubs-core
  • spring-cloud-azure-stream-binder-servicebus-core

The core module should provide the following components:

  • Binding properties, which is to describe extended consumer/producer properties for Azure services
  • Provisioner that allow users to provision destinations
  • Destination that describe the broker destination

Spring Cloud Azure Stream Binder

We should have two modules as

  • spring-cloud-azure-stream-binder-eventhub
  • spring-cloud-azure-stream-binder-servicebus

The binder module should provide the following components:

  • Message Channel Binder that integrate with SCS binder abstraction
  • Autoconfiguration and customizer to provide binder configuration and enable to customize each clients
  • Health Indicator

Azure support for Spring JMS

We should have a module of

  • azure-spring-servicebus-jms

This module aims to provide Spring JMS implemention integrated with Service Bus, which should provide the following components:

  • All kinds of configuration provider
  • Connection Factory to provide amqp connection to Service Bus
Clone this wiki locally