Event/Message hub-based connectivity
The Event/Message hub Publish-Subscribe connectivity is another option for IoT application, specifically if the volume of data ingestion is huge and the number of clients is also large. Event Hub uses Kafka messaging infrastructure and can operate on top of many different connectors, such as WebSocket, HTTP, gRPC, MQTT, and so on. The best case architecture is to use WebSocket with message format in JSON to connect to the Kafka service, or you can use gRPC (HTTP/2 Streaming protocol) with protobuf messaging protocol. Event hub is built to be secure, massively scalable, fault tolerant, and language-agnostic. As can be seen in the following example, the Event Hub acts as a cloud connector and queuing system, which provides durability for many producers (such as devices that can produce time-series information) and forwards it to many subscribers.
The following example shows that, with this model, we can stream data from the devices to the cloud and various types of applications can act on the data:
The publish-subscribe model supports binary JSON over WebSocket and protobuf over gRPC streams for publishing, and binary (protobuf over gRPC) for subscribing. Devices communicate with the Event Hub service by publishing messages to topics. Applications, devices, and services can use Event Hub as a one-stop solution for their communication needs. You can use Event Hub to ingest streaming data from anywhere to the cloud for processing.
Event Hub uses gRPC for publishing and subscribing. A full-duplex streaming RPC framework, gRPC uses protocol buffers for wire protocol. gRPC is implemented over HTTP/2 and uses header compression, multiplexing TCP connections, and flow control. Protocol buffer is a binary protocol, suited for IIoT devices that publish high-velocity data over networks with low bandwidth.
The Event Hub also provides the following:
- Streaming high volumes of data to the cloud for processing, from anywhere
- Payload-agnostic publishing of any type of data for subscriber consumption
- Handling message distribution for subscribers scaling from single to multiple instances
- Handling of large-scale asynchronous message processing applications
- Using OAuth provider for authentication and authorization