FLaNK: Real-Time Transit Information For NY/NJ/CT (TRANSCOM)
FLaNK: Real-Time Transit Information For NY/NJ/CT (TRANSCOM)
SOURCE: XML/RSS REST ENDPOINT
FREQUENCY: Every Minute
DESTINATIONS: HDFS, Kudu/Impala, Cloud, Kafka
The main source of this real-time transit updates for New Jersey, New York and Connecticut is TRANSCOM. I will read from this datasource every minute to know about real-time traffic events that occurring on the roads and transportation systems near me. We will be reading the feed that is in XML/RSS format and parse out the hundreds of events that come with each minutes update.
I want to store the raw XML/RSS file in S3/ADLS2/HDFS or GCS, that's an easy step. I will also parse and enhance this data for easier querying and tracking.
I will add to all events a unique ID and a timestamp as the data is streaming by. I will store my data in Impala/Kudu for fast queries and upserts. I can then build some graphs, charts and tables with Apache Hue and Cloudera Visual Applications. I will also publish my data as AVRO enhanced with a schema to Kafka so that I can use it from Spark, Kafka Connect, Kafka Streams and Flink SQL applications.
- GenerateFlowFile - optional scheduler
- InvokeHTTP - call RSS endpoint
- PutHDFS - store raw data to Object or File store on premise or in the cloud via HDFS / S3 / ADLSv2 / GCP / Ozone / ...
- QueryRecord - convert XML to JSON
- SplitJSON - break out individual events
- UpdateAttribute - set schema name
- UpdateRecord - generate an add a unique ID and timestamp
- UpdateRecord - clean up the point field
- UpdateRecord - remove garbage whitespace
- PutKudu - upsert new data to our Impala / Kudu table.
- RetryFlowFile - retry if network or other connectivity issue.
Send Messages to Kafka
SMM links into the Schema Registry and schema for this topic.
We could also consume this data with Structured Spark Streaming applications, Spring Boot apps, Kafka Streams, Stateless NiFi and Kafka Connect applications.
We also stored our data in Impala / Kudu for permanent storage, ad-hoc queries, analytics, Cloudera Visualizations, reports, applications and more.
It is very easy to have fast data against our agile Cloud Data Lakehouse.
Source Code
Resources
- https://xcm.org/home
- https://data1.xcmdata.org/DEWeb/Pages/index.jsp
- https://511nj.org/home
- https://github.com/tspannhw/ApacheConAtHome2020
- https://github.com/tspannhw/SmartTransit
- https://github.com/tspannhw/SmartStocks