Select to view content in your preferred language

Send "keepalive" message

2700
2
06-03-2014 05:59 AM
GregYetman
Occasional Contributor
Hi,

I'm setting up an input that reads text from a server via UDP with the GeoEvent processor as a client. It works fine using a handshake to sign in. However, the server requires a 'keepalive' message after a successful connection is established, otherwise the connection times out after 60 seconds.

Is there a way to send a message after the initial connection is made? It only needs to be sent once. I was thinking a second GeoEvent Process that sends the message via a udp-out output, but I'm not certain how to provide the text body to the output (it's a simple XML snippet), or how to specify that the message should only be sent once (if I tie it to the input I presume it will send after each received message).

Suggestions welcome!

Thanks,

Greg
0 Kudos
2 Replies
RJSunderman
Esri Regular Contributor
Hello Greg -

You are correct that incorporating an outbound UDP connector, intended to send a keep-alive message to the external server, will not work if it is included in the same GeoEvent Service as the inbound connector used to receive and process input events from that external server. The GeoEvent Service would send an event to the outbound connector for every event received on the input (rather than the single keep-alive message you are looking to send).

You might consider an approach similar to the one described in the Firing" rel="nofollow" target="_blank">http://forums.arcgis.com/threads/109558-Firing-a-GP-Service-P... a GP Service/Python Script thread. If you developed a Python script which monitored the UDP socket along with the GeoEvent Processor, then whatever designates the "first" message received could trigger the Python script to send the necessary keep alive message back to the server. The Python script could then go to sleep and ignore any additional messages received as those are being handled by the GeoEvent Processor.

Another option might be to use the GeoEvent Processor SDK to develop a custom inbound connector for Text/UDP which provided the acknowledgement / keep-alive you are looking for ... the inbound connector available out of the box does not include this capability.

Hope this information helps -
RJ
0 Kudos
GregYetman
Occasional Contributor
Hi RJ,

Thanks, that's useful information. I may look at GEP filters and outputs to trigger a Python "keepalive" script. The remote server sends a successful login response after the initial connection is made, I think that I can filter for the login message and send to a socket on the local machine that the Python script is monitoring when the message is received. This may work better as I can also filter for error or disconnect messages that can be sent by the server if an error is encountered and then send a message (text/e-mail) that the service needs to be restarted.

Looks like I will need to create something custom either way.

Cheers,

Greg
0 Kudos