GeoEvent Processor Web Socket Tutorial

6701
10
11-18-2013 05:36 PM
DarrylWilson
New Contributor II
Hello,

I am looking for the GeoEvent Processor Web Socket Tutorial. However, looking through these I cannot find any.

Could someone please point me in the right direction?

Many thanks

Darryl
0 Kudos
10 Replies
RJSunderman
Esri Regular Contributor
Hello Darryl -

Thank you for checking the product gallery, and apologies for not having up there what you needed. We did prepare a tutorial Working with WebSockets, but didn't post it because it wasn't a very complete user story. The tutorial, as it stands, does not reference a really good input data stream.

That said, there is still information in the tutorial you might find useful. I am, in fact, incorporating information from it as I rework the tutorial for the Twitter connector.

I've attached what we have for Working with WebSockets ... please let me know if you find in there what you need and/or discover something missing that I can help provide.

- RJ
0 Kudos
DarrylWilson
New Contributor II
Hi RJ,

Thank you for posting the tutorial. I have worked through the examples and have found them very useful.

I am trying to configure the "Subscribe to an external Web Socket for JSON."

Looking at the field "Remote server web socket URI (Client Mode):" I am not sure what to enter here. The socket address I want to subscribe to is ws://geoeventsample1.esri.com:8080/exactearthservice however nothing is being received on the input that I have created. I have tried entering the URI with the "ws://"  , "http://" and no URI scheme. Still no input is received.

I can connect to the above web socket using the browser on the the server, so I think the firewall will allow web socket traffic.

Can you please detail how I should connect to this endpoint?

Best Regards

Darryl
0 Kudos
RJSunderman
Esri Regular Contributor
Hey Darryl �??

When configuring a �??Subscribe to an external Web Socket for JSON�?? Input, I think the pattern you want to use for the �??Remote server web socket URI�?? value is:  ws://<server><domain>:<port>/<service>

So for the ExactEarth sample data on geoeventsample1 the value would be:
  • ws://geoeventsample1.esri.com:8080/exactearthservice
Morakot on our team helped me track this down. Here�??s the rough steps we followed to figure it out�?�

  • Browse to http://geoeventsample1.esri.com/demosite in a Chrome Browser

  • Select the �??ExactEarth Vessel Tracking�?? sample service

  • Ctrl-Shift-I to open Chrome�??s Developer tools

  • Under the �??Sources�?? tab, expand to view the HTML code for the �??exactearthservice�??

  • Set a breakpoint in the init : function() to pause script execution as the WebSocket is about to be created

Clicking the �??Connect�?? button in the displayed webpage allowed us inspect the value of the location variable and see the URI being used. Plugging that value into our websocket-json-in input connector, we immediately began receiving JSON event data from the sample service (allowing GEP to create the GeoEvent Definition for us based on its discovery of the event data).

Hope that helps �??
RJ
0 Kudos
DarrylWilson
New Contributor II
Hello,

I am still unable to "Subscribe to an external Web Socket for JSON."

Setting up the input as detailed below no data is received. Upon creating the input I am seeing an error in the log file, please see attached.

Any ideas most welcomed.

Many thanks

Darryl
0 Kudos
RJSunderman
Esri Regular Contributor
Hey Darryl,

I was able to replicate the issue on 10.2.0 ... I am looking for a work around.

Parsing the logging message you attached, it looks like you're running into a component-level validation error. The adapter responsible for interpreting JSON is complaining that it doesn't have a GeoEvent Definition it can use.

Failed to set Adapter (com.esri.ges.adapter.inbound/Generic-JSON/10.2.0)
  properties:
 com.esri.ges.core.validation.ValidationException:
 com.esri.ges.adapter.genericJson.JsonInboundAdapter
  properties validation failed:
 Mandatory property 'ExistingGeoEventDefinitionName' is not set.

 at com.esri.ges.core.property.PropertyCollectionBase.validate(PropertyCollectionBase.java:184)
 at com.esri.ges.manager.stream.internal.InboundAdapterProxy.initAdapter(InboundAdapterProxy.java:74)
 at com.esri.ges.manager.stream.internal.AdapterProxyBase.installAdapter(AdapterProxyBase.java:280)
 at com.esri.ges.manager.stream.internal.AdapterProxyBase.setAdapterUri(AdapterProxyBase.java:73)
 at com.esri.ges.manager.stream.internal.StreamBase.setAdapterUri(StreamBase.java:178)
 (65 more ...)


This issue does not manifest itself with the 10.2.1 candidate release. The 10.2.1 product is being prepared for release to Esri Distributors and we expect that it will be available publicly the second week of January 2014.

Can you please let me know whether you are able to wait for the 10.2.1 product release?  If I need to support you on the 10.2.0 product and we need to prepare a patch, the patch will likely not be available to you until the 10.2.1 product is publicly released.

- RJ
0 Kudos
RJSunderman
Esri Regular Contributor
Hello Darryl -

We have been unable to identify a work around for the issue in which a "?Subscribe to an external Web Socket for JSON"? Input connector is not receiving content from the ws://geoeventsample1.esri.com:8080/exactearthservice sample data when using the 10.2.0 release of GeoEvent Processor.

To confirm, this does not appear to be an issue with the 10.2.1 release.

Please reply to this thread if you are unable to wait for the 10.2.1 product release which should be publicly available the second week of January. (Regional offices, Business Partners, and Distributors should be receiving their distribution the week of December 19th.)

Thanks -
RJ
0 Kudos
DarrylWilson
New Contributor II
Hi RJ,

Thanks, We can wait. Will look forward to the release.

Best Regards

Darryl
0 Kudos
AkihiroKURAKAKE
New Contributor III
Hello everyone,

I'm currently using 10.2.1 trying to retrieve the data from the sample server above by using a �??Subscribe to an external Web Socket for JSON�?? Input.

However, once I set the value (ws://geoeventsample1.esri.com:8080/exactearthservice) and save this setting, the status of the inputs on Manager says "ERROR - Connection refused: no further information." and I get nothing.

Has anyone succeeded in receiving any data?
(Or this sample server no longer works?)

Thanks,

Hiro
0 Kudos
RJSunderman
Esri Regular Contributor
Hello Hiro -

No, there's no known issues with the sample server. I was able this morning, using my 10.2.1 configuration, to create a new input using the web socket endpoint (ws://geoeventsample1.esri.com:8080/exactearthservice) we've been referring to in this thread.

Are you able to reach the HTTP endpoint through a browser? Please take a look at the debugging steps outlined in my reply on 21-Nov-2013 in this thread above. You might be able to obtain some additional information on why the connection is being refused if you're able to step through the JavaScript using the Chrome developer tools. I was able to visit the demosite page (http://geoeventsample1.esri.com/demosite) on a mobile device and connect to the ExactEarth Vessel Tracking service sample from there.

- RJ
0 Kudos