The Send Features to a Stream Service Output Connector can be used to broadcast event data, as feature JSON, via a stream service’s WebSocket. Client applications can subscribe to the stream service’s WebSocket to receive the feature records being broadcast.
Stream services are similar to traditional map and feature services in that they are discoverable when browsing the contents of an ArcGIS Server’s REST Services Directory. A stream service is a type of ArcGIS Server service only available when real-time capabilities are added to ArcGIS Enterprise with a ArcGIS GeoEvent Server license role. Stream services emphasize low latency real-time data dissemination for client-server workflows. A key difference between stream services and traditional map and feature services is that, generally, stream services offer no data persistence. The stream service’s Store Latest capability is an exception to this generalization. Stream services leverage WebSocket technology to establish bidirectional communication and dissemination of data with clients. Clients subscribe to receive the data as it happens in real-time rather than polling a geodatabase to retrieve the data.
A published stream service will not receive or broadcast any data unless a Send Features to a Stream Service Output Connector is configured and incorporated into a GeoEvent Service. For more information on stream services, see Stream services. The Stream Services Tutorial includes exercises to become more familiar with stream services. Videos of stream service capabilities are available in the GeoNet blog Stream Services, Store Latest, and Related Features.
Usage notes
- Use this output connector to format event record data as feature JSON and broadcast the feature records via a stream service’s WebSocket.
- This output connector pairs the JSON Outbound Adapter with the Stream Service Outbound Transport.
- To use stream services, you must have licensed ArcGIS Server, ArcGIS GeoEvent Server, and the ArcGIS GeoEvent Server service must be running.
- ArcGIS Server, beneath which ArcGIS GeoEvent Server is running, may be federated with an ArcGIS Enterprise portal, but when leveraging stream services, administration is often simpler when ArcGIS Server is not federated.
- The Publish Stream Service capability, available when configuring a new output, is used to publish a stream service directly from GeoEvent Manager.
- You should use the server connection registered with GeoEvent Server as its Default data store when publishing stream services.
- To publish a stream service, you must have an existing GeoEvent Definition whose schema reflects the fields you want in the stream service.
- A stream service’s underlying WebSocket runs as part of ArcGIS GeoEvent Server, not ArcGIS Enterprise. When publishing a stream service using the Default server connection, and this server connection’s URL reflects an ArcGIS Enterprise portal endpoint, the service publication mechanism will handle publishing the stream service to the machine on which ArcGIS GeoEvent Server is running. The published service will be registered with the ArcGIS Enterprise portal as a content item.
- The workflow separation best practice recommends ArcGIS Enterprise be deployed to a server machine separate from the machine used to run ArcGIS GeoEvent Server. The Default server connection in GeoEvent Server maintains information which helps identify the correct machine to which the stream service should be published.
Parameters
Parameter | Description |
---|---|
Name | A descriptive name for the output connector used for reference in GeoEvent Manager. |
ArcGIS Server Connection | An ArcGIS Server or ArcGIS Enterprise connection registered with GeoEvent Server as a data store. Hinweis:It is recommended the ArcGIS Server or ArcGIS Enterprise connection registered as the GeoEvent Server Default data store be used when publishing stream services. Stream services must be published to an ArcGIS Server licensed with the GeoEvent Server role. Publishing stream services to an ArcGIS Server that is not licensed and configured as a GeoEvent Server is no supported. |
Folder | An ArcGIS Server services folder discoverable in the ArcGIS REST Services Directory. Stream services cannot currently be published to an ArcGIS Enterprise portal content item folder. When federated with an ArcGIS Enterprise portal, you should publish stream services to the Root folder. |
Folder | The name of the feature service to which processed event data will be added as new feature records. |
Stream Service Name | The name of the stream service to which processed event data will be sent as feature records. |
Update Interval (seconds) | Specifies the interval (in seconds) the output connector will flush its cache of processed event records by sending them to the specified stream service as feature records. The default is 0.1 seconds, which means data from processed event records will be cached and the cache flushed ten times every second. Event records broadcast as feature records should be relatively simple with minimal attributes and simplified geometries to support the stream service emphasis of low latency real-time data dissemination. |
Formatted JSON | Specifies whether the feature JSON string will be prettified with whitespace indention and newline formatting. This JSON, sometimes referred to as PJSON, is generally only appropriate when writing to a system file whose content might be reviewed in a text editor. The default is No.
|
Enforce Unique TrackID | Specifies whether an event record’s tagged TRACK_ID field should be used as a unique identifier to update feature records broadcast by the stream service. The default is No. Hinweis:This property is not currently implemented in GeoEvent Server and should be left set to its default of No. See the Limitations below. |
Limitations
The Enforce Unique TrackID property was intended to provide information to subscribing client applications allowing their behavior to change from a simple feature record receiver to one that allows feature record updates. When the property is set to No, the default, clients subscribing to a stream service’s broadcast would treat each feature record as a new observation. The overall behavior would mimic an add a feature workflow where a new feature record is displayed for each feature record broadcast. Setting the Enforce Unique TrackID property to Yes would change the behavior to mimic an update a feature workflow, where the last feature record’s position and attributes could be updated as new feature records are broadcast by the stream service.
In practice, it does not matter how the Enforce Unique TrackID property is set. Changing this property value does not alter a published stream service’s JSON specification. ArcGIS Enterprise and ArcGIS Online web map implementations of the StreamLayer currently use a stream service’s specified trackIdField found beneath the service’s timeInfo specification to control whether a stream layer displays new feature records with each feature record broadcast or updates previously received feature records as new feature records are broadcast. Web mapping applications implemented using the ArcGIS API for JavaScript can choose to mimic this behavior or implement their own behavior.
It is recommended the Enforce Unique TrackID property be set to No, the default, and the add a feature or update a feature behavior be controlled by tagging an attribute field whose value can be used to uniquely identify a sensor or trackable asset.
If the stream service is published using a GeoEvent Definition with an attribute field tagged TRACK_ID, client applications can retrieve the attribute field’s name from the published service’s specified trackIdField and update the layer’s cache and/or feature display as new feature records are broadcast. If a stream service is published using a GeoEvent Definition that does not have a TRACK_ID tagged attribute field, the published stream service will not include a trackIdField value in its specification and clients will have to default to treat every feature broadcast as a unique observation not affiliated with any particular sensor or trackable asset.