Hello @Baibhav M !
Welcome to Microsoft QnA!
Lets sum it up for you !
The Azure Web PubSub Service helps you build real-time messaging web applications using WebSockets and the publish-subscribe pattern easily. This real-time functionality allows publishing content updates between server and connected clients (for example a single page web application or mobile application). The clients do not need to poll the latest updates, or submit new HTTP requests for updates.
There are many different ways to program with Azure Web PubSub service, as some of the samples listed here:
-
Build serverless real-time applications: Use Azure Functions' integration with Azure Web PubSub service to build serverless real-time applications in languages such as JavaScript, C#, Java and Python.
-
Use WebSocket subprotocol to do client-side only Pub/Sub - Azure Web PubSub service provides WebSocket subprotocols to empower authorized clients to publish to other clients in a convenience manner.
-
Use provided SDKs to manage the WebSocket connections in self-host app servers - Azure Web PubSub service provides SDKs in C#, JavaScript, Java and Python to manage the WebSocket connections easily, including broadcast messages to the connections, add connections to some groups, or close the connections, etc.
-
Send messages from server to clients via REST API - Azure Web PubSub service provides REST API to enable applications to post messages to clients connected, in any REST capable programming languages.
Azure Event Hubs is a cloud native data streaming service that can stream millions of events per second, with low latency, from any source to any destination. Event Hubs is compatible with Apache Kafka, and it enables you to run existing Kafka workloads without any code changes.
Using Event Hubs to ingest and store streaming data, businesses can harness the power of streaming data to gain valuable insights, drive real-time analytics, and respond to events as they happen, enhancing overall efficiency and customer experience.
Summary:
-
Azure Web PubSub is suitable for handling real-time messaging scenarios.
-
Azure Event Hubs is optimal when you need to efficiently ingest, buffer, store, and process large volumes of events/data streams.
So you don't NEED to but you can if you want to use Web PubSub for real-time communication and then pushing the data/messages into Event Hubs for further analysis or processing.
Also :
https://learn.microsoft.com/en-us/azure/azure-web-pubsub/socketio-overview
Socket.IO is a widely popular open-source library for real-time messaging between clients and a server. Managing stateful and persistent connections between clients and a server is often a source of frustration for Socket.IO users. The problem is more acute when multiple Socket.IO instances are spread across servers.
Azure provides a fully managed cloud solution for Socket.IO. This support removes the burden of deploying, hosting, and coordinating Socket.IO instances for developers. Development teams can then focus on building real-time experiences by using familiar APIs from the Socket.IO library.
So if :
You want to ingest and process the messages/events coming through your real-time communication layer.
You have further data analytics, processing, or storage requirements.
Then yes you can integrate both but it is not a requirement !
References :
https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-samples
https://learn.microsoft.com/en-us/azure/azure-web-pubsub/socketio-overview
https://learn.microsoft.com/en-us/azure/azure-web-pubsub/overview
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards