Select to view content in your preferred language

[Geo event] How to send real-time data to one or more device?

3649
1
08-07-2015 12:49 AM
sonhoang_bich
Deactivated User

Hi every one,

I have many mobile device was connected to a web socket and now i want to send data to one or group devices in them. How to do it?

Thanks....

P/s: sorrry, my enlish is not main language.

Tags (2)
0 Kudos
1 Reply
RJSunderman
Esri Regular Contributor

Hello -

Assuming you are interested in continuing to have mobile devices connect via web socket, you will probably want to use a GeoEvent stream service output. There is no built-in concept of addressing event data broadcast by a stream service output to a specific recipient, single mobile device, or group of devices. A client subscribing to the the stream service generally receives all event data being broadcast by the output.

If it is acceptable that clients subscribing to the stream service can potentially receive all event data, but prefer to receive only data intended for them, they can use attribute filtering supported by the web socket to configure the connection. The event data would, of course, need to include an attribute the subscribing client could include in its filter. To implement this you will probably need to develop a solution using the ArcGIS API for JavaScript​​​ to bring event data broadcast by the stream service in as a stream layer​​. That way you can use the setDefinitionExpression method (on the StreamLayer class) to configure each client/server web socket connection such that only data with a client-specific attribute is sent from the server to a specific client.

If you do not want to develop a client-side solution, you could configure a GeoEvent Service to handle the filtering. You would configure a Filter element within a GeoEvent Service such that only messages for a particular client (based on the client identifier) were sent to a particular stream service output. The GeoEvent Service would then have separate outputs for each potential client. Individual clients could then be directed to subscribe to a specific GeoEvent output's stream and receive all of the data being provided by that output.

The downside to the server-side approach is that you would have to "hard code" filters into a GeoEvent Service to handle all of the different client identifiers. This isn't necessarily a problem if you have a fixed, well-known set of subscribers -- but could become a headache if you have to update your GeoEvent Service every time you want to add a subscriber to the solution.

Hope this information helps -

RJ

Note:  A draft of the technical workshop 'Leveraging Stream Services' slides from the 2015 User Conference are available at the following link: Real-Time GIS: Leveraging Stream Services. Videos of the technical workshops should be available to review and download fromEsri's E80 site​ in a few weeks.