Partners often desire a stable and high performance integration pipeline. Websockets (and even Webhooks) are the first tools thought to solve the problem. Websockets offer an easy way to get a look at the head of the stream. The websocket provides high performance, real-time streaming data. The problem with websockets is that the consumer usually needs to add a significant amount of code to robustly and reliably consume the data. It is the responsibility of the consumer to handle reconnects if the websocket connection goes down. Since the data is a near-real time stream of the head, the consumer will have a gap in the data while reconnecting. The websocket server does not have a mechanism to move a "cursor" through the stream.
There are several cloud scale grade stream processing technologies available that eliminate the pain of integrating data streams. Bluzone aims to integrate with several of the leading providers. At this time, Bluzone supports Amazon AWS Kinesis (https://aws.amazon.com/kinesis/). The integration path is extremely straightforward. Amazon provides excellent documentation and examples for setting up a stream and implementing a consumer client.
The following steps describe the process for configuring a Bluzone Project to export data to an Amazon Kinesis Stream.
The Bluzone cloud will take up to 10 minutes to setup your stream. Once it starts writing data, you will be able to consume from the stream with any of the provided reference libraries.
The following streams are currently supported by Bluzone:
The raw packet data that is read from the Blufi devices
A stream of location messages for use with RTLS deployments.
{ "type": "location", "projectId": 1336, "id": "3777777777777777777", "mac": "01:ef:07:07:07:07:07", "floorNumber": 1, "deviceName": "door beacon", "latitude": 25.256818055638366, "longitude": 55.37758749303774, "altitude": 0.0006927130743861198, "location": "25.256818055638366, 55.37758749303774", "timestamp": "2016-02-24T16:58:14.014Z", "varianceX": 10.906546468979249, "varianceY": 17.58863642627552, "varianceZ": 0 } |
Message tracking Policy state change events.
Note: the "uniqueDeviceId" is the beacon deviceId when policy namespace is "BEACON".
See: Policy Event Stream API v1
{ "eventUuid": "7c8d1944-ffe0-4812-9519-18afd0e01a3e", "projectId": "1336", "policyId": "143333122", "blufiId": "732222122", "uniqueDeviceId": "8686868686868686868", "oldState": "OK", "newState": "VIOLATING", "value": "60", "timestamp": 1456850995739, "timestampCleared": null } |