<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Stream Layer With Custom WebSocket URL + Azure WebPubSub + JS API 4.24 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1287144#M81097</link>
    <description>&lt;P&gt;Are you implementing your own websocket server because you are also finding that GeoEvent is not able to handle properly websockets using stream layers with real world rates of events per second? - like from 20-40 events per second) like in our case.&lt;/P&gt;</description>
    <pubDate>Sun, 28 May 2023 02:10:18 GMT</pubDate>
    <dc:creator>WalterSimonazzi_VicPol</dc:creator>
    <dc:date>2023-05-28T02:10:18Z</dc:date>
    <item>
      <title>Stream Layer With Custom WebSocket URL + Azure WebPubSub + JS API 4.24</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1227804#M79210</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to setup a StreamLayer with a custom WebSocket url, using Azure WebPubSub.&lt;/P&gt;&lt;P&gt;using the simple constructor as seen below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const streamLayer = new StreamLayer({
    popupTemplate: {
      content: "OBJECTID={OBJECTID}, TRACKID={TRACKID}",
    },

    webSocketUrl: "wss://stream-layer.webpubsub.azure.com/client/hubs/SomeHub?access_token=xxx",

    objectIdField: "OBJECTID",

    fields: [
      {
        name: "OBJECTID",
        alias: "ObjectId",
        type: "oid",
      },
      {
        name: "TRACKID",
        alias: "TrackId",
        type: "oid",
      },
    ],

    timeInfo: {
      trackIdField: "TRACKID",
    },

    geometryType: "point",

    maxReconnectionAttempts: 100,
    maxReconnectionInterval: 10,

    renderer: {
      type: "simple",
      symbol: {
        type: "simple-marker",
        size: "8px",
        color: "gray",
      },
    },
  });

  map.add(streamLayer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Azure WebPubSub requires an access token to be added as a query string to the end of the websocket url.&lt;/P&gt;&lt;P&gt;wss://stream-layer.webpubsub.azure.com/client/hubs/SomeHub?access_token=xxx&lt;/P&gt;&lt;P&gt;For some reason when trying use the websocket url on StreamLayer, it seems to remove the query string from the end of the websocket url?&lt;/P&gt;&lt;P&gt;So you end up with:&amp;nbsp;wss://stream-layer.webpubsub.azure.com/client/hubs/SomeHub&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 08:27:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1227804#M79210</guid>
      <dc:creator>Koob</dc:creator>
      <dc:date>2022-11-02T08:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Layer With Custom WebSocket URL + Azure WebPubSub + JS API 4.24</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1227823#M79213</link>
      <description>&lt;P&gt;okay, found the answer:&lt;/P&gt;&lt;P&gt;needed to add custom parameters&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;customParameters: {
   access_token: "token"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 10:57:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1227823#M79213</guid>
      <dc:creator>Koob</dc:creator>
      <dc:date>2022-11-02T10:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Layer With Custom WebSocket URL + Azure WebPubSub + JS API 4.24</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1287144#M81097</link>
      <description>&lt;P&gt;Are you implementing your own websocket server because you are also finding that GeoEvent is not able to handle properly websockets using stream layers with real world rates of events per second? - like from 20-40 events per second) like in our case.&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 02:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/stream-layer-with-custom-websocket-url-azure/m-p/1287144#M81097</guid>
      <dc:creator>WalterSimonazzi_VicPol</dc:creator>
      <dc:date>2023-05-28T02:10:18Z</dc:date>
    </item>
  </channel>
</rss>

