Azure Streaming Returning Data

160 views Asked by At

How can azure stream return the processed data in real-time? I see most examples pushing processed data back to a DB or dashboard. I need everything to happen in real-time for a single request (step 4). How do you achieve this with minimal latency? Example below:

1) Page requested by client 2) Page sends some data to azure stream 3) Azure Stream does logic and calculations with data and data from 5 second window 4) Sends result back to Page so it can perform some IMMEDIATE action 5) Stores result in database for reporting

1

There are 1 answers

0
Tim Benroeck On

You can set the output to be an Azure Service Bus EventHub, Queue, or Topic and have your application monitoring one of those outputs. The workflow would be something like:

  1. Page requested by client
  2. Page sends data to ASA (Azure Stream Analytics). Note: you are really sending data to an Azure Event Hub which has an ASA job running with the EH as an input.
  3. The ASA job does it's logic / query and outputs to a different Azure EventHub (or Queue or Topic).
  4. You have a Web Job or server side job monitoring the output EventHub and use websockets to relay that information back to the client.

You can find some example code on the Microsoft Connect the Dots example. In this example IoT devices are sending weather data to an Azure EventHub and there is an ASP.NET site that is monitoring that EventHub and through websockets updating the clients.