question

kumaraswamygosukonda-2537 avatar image
0 Votes"
kumaraswamygosukonda-2537 asked ·

how to maintain multiple streams in single IOT Hub?

i have a situation like, we have single IOT hub which will receive compressed data and uncompressed data. we have single stream analytics service to process IOT hub messages, i have added two inputs in Azure Stream Analytics to process compressed and uncompressed data.

i just wanted to route compressed messages to one input (Stream Analytics) and uncompressed messages to another input to process both stream of data with single instance of IOT Hub and Stream Analytics.

azure-ad-authenticationazure-ad-libraries
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarileeTurscak avatar image
0 Votes"
MarileeTurscak answered ·

Hi,

Unfortunately this service is not supported in Q&A yet (slated to be added in May). You will need to ask on MSDN for now. https://social.msdn.microsoft.com/Forums/en-US/home?category=InternetOfThings

I have alerted that team about this thread but they do not appear to have Q&A profiles set up.

This thread looks somewhat related to your ask, though. https://stackoverflow.com/questions/58724735/stream-analytics-process-compressed-and-uncompressed-data-in-same-job

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SandervandeVelde42 avatar image
0 Votes"
SandervandeVelde42 answered ·

You need to define two separate inputs in your Stream Analytics job.

Stream Analytics inputs you have to use, are either of type IoT Hub or Event Hub. Both support Event compression, like GZip or Deflate.

If both the two types of messages were not compressed, you could connect the default, built-in endpoint to multiple inputs, each with their own consumer group and filter within the job.

Due to the mixed compressed/not compressed telemetry situation, you have to split your IotHub telemetry before handing it over to the stream analytics job.

This can be done using the IoTHub routing, together with an Eventhub:

  1. Create an eventhub namespace and one eventhub

  2. Create an iot hub custom endpoint and connect it to this eventhub

  3. Disable the fallback route in the IotHub (just to prevent mixing non-filtered messages with the compressed ones)

  4. Create a route with the default built-in endpoint, listening to compressed messages **)

  5. Create a route with the evenhub listening to non-compressed messages **)

  6. In the ASA job create an iothub input for the compressed messages

  7. In the ASA job create a second Eventhub input for the uncompressed messages

**) You have to use the routing query to split the messages. I recommend using an application property like compressed='gzip' to split the incoming messages over the two routes.

The Message class has a property bag for that. Splitting using a message body value is hard (not possible?) due to the compressed nature of messages (I expect, only the body is compressed).

You could also try to accomplish this with two event hubs instead of one iothub endpoint and one eventhub.

See also this tutorial.

do not forget to mark the right answer

(do not forget to mark the right answer)

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.