I'm developing an application where graphs need to be populated from realtime data.
The Real-Time data comes from a Kafka Queue.
How should I send this real-time data to the front-end which is in Angular8?
So far I have thought of two approaches:
Use a push-based queue mechanism from the server over the Kafka queue, and then transfer the data to the Front-end via Server-Sent Events (SSE) whenever new data is fetched from the queue (since this will not be duplex communication).
Use a push-based Kafka queue and subscribe to it from Angular itself.
I know web-scockets can be an option, but I don't need a duplex communication. Data will only be sent from the server.
Is this the right approach? Or is there any other better way
Also, is it a good practise to subscribe to a queue from the front-end?
I'm using Django for the back-end and Angular for the front-end