geoevent server: a developer's guide...easily integrate real-time streaming data into arcgis...

47
GeoEvent Server: A Developer's Guide Mark Bramer Esri Professional Services Vienna, VA DevSummit DC February 15, 2017 | Washington, DC

Upload: others

Post on 19-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

GeoEvent Server:

A Developer's GuideMark Bramer

Esri Professional Services

Vienna, VA

DevSummit DC

February 15, 2017 | Washington, DC

Page 2: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Agenda

• Connectors

- Inbound

- Outbound

• GeoEvent SDK

• Transports and Adapters

• Processors

• Maven

• Scripting “upstream”

Page 3: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Real-Time GISIntegration and exploitation of streaming data

• Integrates real-time

streaming data

into ArcGIS

• Performs continuous

processing and

real-time analytics

• Sends updates and alerts

to those who need it

where they need it

ArcGIS Enterprise

GeoEvent

Server

DesktopWeb Device

Page 4: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Connectors

Page 5: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

ConnectorsWhat is a connector?

• Connectors get event data into, and out of, GeoEvent Server

• Every connector has two components

- Transport

- Adapter

• Transports and Adapters can be inbound or outbound:

- Inbound transport – connects to and gets raw bytestream

- Inbound adapter – converts raw bytestream into a geoevent

- Outbound adapter – converts geoevent into a byte array, formatted for an output type

- Outbound transport – accepts arrays of bytes from the adapter and transmits them

Page 6: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Receiving Real-Time DataEasily integrate real-time streaming data into ArcGIS using an Input Connector

You can create

your own

connectors.

GeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

Poll an ArcGIS Server for Features

Poll an external website for GeoJSON, JSON, or XML

Receive Features, GeoJSON, JSON, or XML on a REST endpoint

Receive RSS

Receive GeoJSON or JSON on a WebSocket

Receive Text from a TCP or UDP Socket

Subscribe to an external WebSocket for GeoJSON or JSON

Watch a Folder for new CSV, GeoJSON, or JSON Files

Ou

t o

f th

e B

ox

REST

.csv

WS

WS

HTTP

Esri

Gallery

ActiveMQ

CAP

Instagram

Exploitation Support Data

Cursor-on-Target

RabbitMQ

NMEA 0183

MQTT

Sierra Wireless (RAP)

KML

Kafka

Trimble (TAIP)

Twitter

Pa

rtn

er

Ga

lle

ry

CompassLDE

enviroCar

GNIP

FAA (ASDI)

exactEarth AIS

Zonar

Valarm

Networkfleet

OSIsoft *

*

*

*

*

Page 7: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

you can create

your own

connectors

GeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

Feature-JSON

Connectors Transport Adapter

GeoJSON

Receive Feature-JSON from Kafka

Receive GeoJSON on a REST endpoint

Feature-JSON

Adapters

GeoJSON

JSON

RSS

Text

XML

CAP

Cursor-on-Target

GeoMessage

Instagram

NMEA

Sierra Wireless (RAP)

Trimble (TAIP)

Twitter

VMF

Esri

Gallery

Waze

Feature Service

Transports

File

HTTP

HTTP+BasicAuth

HTTP+OAuth

TCP

UDP

Waze

WebSocket

Esri

Gallery ActiveMQ

IRC

Kafka

MQTT

RabbitMQ

Twitter

Kafka

HTTP

Receiving Real-Time DataInput Connector = Transport + Adapter

Page 8: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

You can create

your own

connectors.

Sending Real-Time DataEasily disseminate notifications, alerts, and updates using an Output Connector

GeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

Ou

t o

f th

e B

ox

Add or Update a feature

Publish Text to a UDP Socket

Send a Text Message

Send an Email

Push Text to an external TCP Socket

Push GeoJSON or JSON to an external WebSocket

Push GeoJSON or JSON to an external Website

Send an Instant Message

Send Features to a Stream Service

Write to a CSV or JSON File .csv

WS

im

HTTP

ActiveMQ

Esri

Gallery Cursor-on-Target

Hadoop

Kafka

MongoDB

RabbitMQ

Twitter

Page 9: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

you can create

your own

connectors

GeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

Message Formatter SMTP

Connectors TransportAdapter

Feature-JSON Kafka

Send an Email

Publish Feature-JSON to Kafka

Big Data Store

Transports

Feature Service

File

HTTP

HTTP+BasicAuth

HTTP+OAuth

SMTP

Stream Service

TCP

UDP

WebSocket

XMPP

Cache

Adapters

Feature-JSON

GeoJSON

JSON

Message Formatter

RSS

Text

WebSocket

ActiveMQ

Hadoop

IRC

Kafka

MongoDB

MQTT

Esri

Gallery

RabbitMQ

TCP-Squirt

Twitter

Cursor-on-Target

Esri

Gallery

SMS

Sending Real-Time DataOutput Connector = Adapter + Transport

Page 10: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Creating InputsInputs are configured using Connectors

GeoEvent Server

National Weather

Service

US Geological Survey

Live Traffic Services

Ou

tpu

ts

GeoEvent ServicesStorms

Earthquakes

Traffic

Receive Text via TCP

Connectors

Inputshttp://

RSS Connector

Cre

ate

In

pu

t

JSON over REST

Cre

ate

In

pu

t

Page 11: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

ConnectorA Connector’s Purpose

• By choosing a Connector, the user implicitly selects components from

GeoEvent Server that know:

HOW to move data (Transport)

WHAT the data looks like (Adapter)

Example Input

TCP Transport Text Adapter

Input (Receive text from a TCP Socket)

Start

StopByte [ ]

GeoEventGeoEvent Services

Page 12: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

GeoEvent Server

SDK

Page 13: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

You can create your own custom transports, adapters and processors using the

GeoEvent Software Development Kit (SDK).

Extending GeoEventSoftware Development Kit (SDK)

Your processors

Your

connectors

Your

connectors

GeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

A note on semantics: the SDK is used to build transports, adapters and processors. Input and output

connectors are built by pairing a transport and adapter in GeoEvent Manager.

Page 14: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

- api: JavaDoc content associated with GeoEvent Server SDK

- repository: Local maven repository

- samples: Sample processors, transports, adapters

- GeoEvent Server Developer Guide

Extending GeoEvent ServerSoftware Development Kit (SDK)

Page 15: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Transports

Page 16: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

TransportWhat makes up a Transport?

Transport Definition • Defines transport metadata and properties

Transport • Implements transport application logic

Transport Service • Provides a Transport Definition

• Instantiates new Transports

Page 17: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

• Transports are given

- Properties that define behavior

- A “ByteListener” where bytes should be sent

• Transport is started by the server and it sends bytes to the receiver

• Transport is stopped by the server and it stops sending bytes

Transport BehaviorTransports

Page 18: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Transport LifecycleTransports

Transports have a lifecycle that determines if they are producing data

STOPPED

STOPPING

STARTED

STARTING

ERROR

STOPPED

Server calls start() Transport reads

properties and starts

Server calls stop()Transport closes

resources

Internal error occurs

STARTED

Page 19: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

• Outbound Transports accept arrays of bytes from the Adapter and transmit them.

• Occasionally the destination for the bytes depends on content in the GeoEvent.

- The Transport has the option of “looking back” at the GeoEvent that generated the bytes, and

using it to route the data.

Outbound TransportsTransports

Page 20: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Adapters

Page 21: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

AdapterWhat makes up an Adapter

Adapter • Implements adapter application logic

Adapter Definition • Defines adapter metadata and properties

Adapter Service • Provides an Adapter Definition

• Instantiates new Adapters

Page 22: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

• Adapters are given

- Properties that define behavior

- A “GeoEventListener” where the GeoEvents should be sent

• Adapters are DATA DRIVEN

- No start/stop calls

- The adapter is handed a byte array and pushes any generated GeoEvents to the Listener

Adapter BehaviorAdapters

Page 23: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Custom

Connectors

Page 24: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

- Use SDK to build transports or adapters

- Custom connector made by pairing transport with an adapter

- Both transport and adapter can be custom, or custom transport only or custom

adapter only

Custom Connectors With DevelopmentTransport + Adapter

Page 25: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

- You actually may not need the SDK to make a custom connector

- Familiarize yourself with all out-of-box transports and adapters

- Out of box connectors do not cover all unique permutations of adapter and

transport pairings

- You may already have all building blocks to make your “custom” connector

Custom Connectors Without DevelopmentTransport + Adapter

Page 26: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Clone an existing connector & tailor it’s properties to make a more specific connector

Custom Connectors Without Development

Page 27: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Clone an existing connector & tailor it’s properties to make a more specific connector

Custom Connectors Without Development

Page 28: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Extend GeoEvent Server by downloading additional transports, adapters and processors

https://github.com/esri/solutions-geoevent-java

http://links.esri.com/geoevent-gallery

More Options on the GeoEvent Gallery

Page 29: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

DEMO Custom Adapter:

regexText-adapter…developed using SDK

Page 30: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

DEMOCustom Connector:

XML over TCP …no development required

Page 31: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Processors

Page 32: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

ProcessorsWhat is a processor?

• Processors perform some action on each GeoEvent passed to it

• Processors can be used to:

- Modify existing fields or the geometry

- Add new fields

- Filter

- Create new GeoEvent(s)

- Perform GeoFencingGeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

Processors

Page 33: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Applying real-time analyticsGeoEvent Processing

You can create

your own

processors.

• You can perform continuous analytics on GeoEvents as they are received using

a processor.

GeoEvent Server

Inp

uts

Ou

tpu

ts

GeoEvent Services

Buffer Creator

Convex Hull Creator

Difference Creator

Envelope Creator

Field Calculator

Field Enricher

Field Mapper

Geotagger

Incident Detector

Intersector

Projector

Simplifier

Symmetric Difference

Track Gap Detector

Field Reducer Union Creator

Ou

t o

f th

e B

ox

Add XYZ

Esri

Gallery

Bearing

Ellipse

Event Volume Control

Extent Enricher

Field Grouper

GeoNames Lookup

Range Fan

Reverse Geocoder

Service Area Creator

Symbol Lookup

Track Idle Detector

Unit Converter

Visibility

Motion Calculator Query Report

Page 34: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

ProcessorLifecycle Review

GeoEvent Server

GeoEvent Service

Processor

Validation

Shutdown Initialization

Creation

Processing…

Page 35: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Anatomy of a ProcessorWhat makes up a Processor?

• Implements processor lifecycle

Configuration • Defines processor, it’s dependencies and metadata

Processor Definition • Defines processor metadata, properties

and GeoEvent Definition(s)

Processor

Processor Service • Instantiates processor definition, processor and

applies configuration

Page 36: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Maven

Page 37: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

- Maven is an Apache project for automated software building, dependency

management, and testing

- Using Maven in secure environments raises some unique and potentially

extremely frustrating challenges

- Internet connectivity is at the core of most Maven installations

- All of the GeoEvent SDK samples are Maven projects

- Recommended you start with an existing sample

- Using the GeoEvent SDK means using Maven

- It is possible set up a GeoEvent project without Maven, but it can be very very

frustrating!

For those of us in closed, secure environments…Maven

Page 38: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

- So with all this caution, why and how would I even do this?

- It’s not that bad, just know these things:

• Read the Developer Guide, especially:

- “Overview of the Sample Projects”

- “Using Eclipse to Edit and Build Custom Components”

- “Starting a New Project”

- “Building and Deploying the Sample Projects”

- At least one sample in “The Sample Projects”

- Continued…

For those of us in closed, secure environments…Maven

Page 39: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

• Build outside your work environment, where you have internet connectivity

- Use one of the samples in the SDK to get started – one from the Developer Guide

- This downloads dependencies to your local machine

- Burn your entire .m2 folder to CD

- Hidden by default

- C:\Users\username\.m2 on Widows

- /root/.m2 on Linux

- Place .m2 in equivalent location in secure environment

- Create .m2/settings.xml file and point to local repository

For those of us in closed, secure environments…Maven

Page 40: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

- Find out if your agency or department has a repository manager

- Artifactory

- Sonatype

- Archiva

- If so, deploy the artifacts to the repository manager

- Update your local /.m2/settings.xml to reference the repository manager

For those of us in closed, secure environments…In-house Maven

Page 41: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Scripting “Upstream”

Page 42: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Scripting “upstream”Alternate pattern for ingesting real-time data

• What if I don’t know Java?

• What if I don’t have time to learn a new SDK?

• What if I don’t want to (maybe) have to re-compile my connector at each new

GeoEvent version?

Page 43: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Scripting “upstream”Alternate pattern for ingesting real-time data

• Possible and easy to write your own app

• Runs “upstream” from GeoEvent

• Consumes real-time feed

• Parses and transforms data

• Sends data to GeoEvent in easy out-of-box form, like csv

Page 44: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Scripting “upstream”CTfastrak

• GTFS = General Transit Feed Specification

- Common format for public transportation schedules

• GTFS-realtime

- Trip updates

- Alerts

- Vehicle positions

• CTfastrak

- Bus Rapid Transit system in Connecticut

- http://www.cttransit.com/about/developers/gtfsdata/

• GTFS is not native to GeoEvent

Page 45: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

DEMOPython for CT Transit

GTFS-rt

https://github.com/Esri/public-transit-tools/tree/master/send-GTFS-rt-to-GeoEvent

Page 46: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Summary

• Connectors get data in and out of GeoEvent.

• Connectors pair a transport and an adapter.

• You can develop your own transports and adapters.

• You can configure your own connectors by pairing transports and adapters (custom

developed or out-of-box).

• Processors perform analytics on geoevents.

• You can build your own processors, as well.

• Maven is a key component to development with the GeoEvent Server SDK.

• You can also employe alternate tactics for custom GeoEvent development, such as

writing scripts that send data to GeoEvent.

Page 47: GeoEvent Server: A Developer's Guide...Easily integrate real-time streaming data into ArcGIS using an Input Connector You can create your own connectors. ... Kafka MongoDB RabbitMQ

Questions?

GeoEvent Server: A Developer’s Guide

DevSummit DC

February 15, 2017 | Washington, DC