Skip To Content

Send Features to a Stream Service

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 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 details 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 Esri Community blog Stream Services, Store Latest, and Related Features.

Usage notes

Keep the following in mind when using the Send Features to a Stream Service output connector:

  • 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 and ArcGIS GeoEvent Server, and the GeoEvent Server service must be running.
  • ArcGIS Server, beneath which 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.
  • Service layers can be referenced using the Browse to Service option or by specifying a URL using the Service URL option in the Reference to Service Type parameter. Both options require a registered data store connection be established first.
  • The Publish Stream Service capability, available when configuring a new output, is used to publish a stream service directly from GeoEvent Manager.
  • 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 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 GeoEvent Server is running. The published service will be registered with the ArcGIS Enterprise portal as a content item.
  • For workflow separation, it is recommended that you deploy ArcGIS Enterprise to a server machine separate from the machine used to run GeoEvent Server. The default server connection in GeoEvent Server maintains information that helps identify the correct machine to which the stream service should be published.

Parameters

The following are the parameters for the Send Features to a Stream Service output connector:

ParameterDescription

Name

A descriptive name for the output connector used for reference in GeoEvent Manager.

Registered server connection

An ArcGIS Server or ArcGIS Enterprise connection registered with GeoEvent Server as a data store.

Remarque :

It is recommended that you use the ArcGIS Server or ArcGIS Enterprise connection registered as the GeoEvent Server default data store 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 not supported.

Reference to Service Type

Specifies the options for referencing a service.

  • Browse to Service—Reference a service by browsing the folders of a registered data store.
  • Service URL—Reference a service by specifying the URL of the shared service.

Folder

(Conditional)

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 GeoEvent Server is federated with an ArcGIS Enterprise portal, publish stream services to the Root folder.

The Reference to Service Type parameter is shown when set to Browse to Service and hidden when set to Service URL.

Stream Service Name

(Conditional)

The name of the stream service to which processed event data will be sent as feature records.

The Reference to Service Type parameter is shown when set to Browse to Service and hidden when set to Service URL.

Service URL

(Conditional)

The URL to a stream service.

Remarque :

A data store connection must be established when referencing a stream service by URL. The stream service must either be publicly accessible or shared with the user whose credentials establish the data store connection.

The Reference to Service Type parameter is shown when set to Service URL and hidden when set to Browse to Service.

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 must have 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 indentation and newline formatting. This JSON, sometimes referred to as PJSON, is generally only appropriate when writing to a system file whose content may be reviewed in a text editor. The default is No.

  • Yes—The feature JSON will be formatted (prettified).
  • No—The feature JSON will not be formatted.

Enforce Unique Track ID

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.

Remarque :

The parameter is not currently implemented in GeoEvent Server and must be left set to its default of No. See the Considerations and limitations section below.

Considerations and limitations

The Enforce Unique TrackID parameter was intended to provide information to subscribing client applications, allowing their behavior to change from a feature record receiver to one that allows feature record updates. When the parameter 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 in which a new feature record is displayed for each feature record broadcast. Setting the Enforce Unique TrackID parameter to Yes would change the behavior to mimic an update a feature workflow, in which 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 parameter is set. Changing this parameter 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 Maps SDK for JavaScript can mimic this behavior or implement their own behavior.

It is recommended that you set the Enforce Unique TrackID parameter to No, the default, and that you control the add a feature or update a feature behavior 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 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 must default to treat every feature broadcast as a unique observation not affiliated with any particular sensor or trackable asset.