# Publish/Subscribe-Middleware-Based Intelligent Transportation Systems: Applications and Challenges
## 4 Application of Publish/Subscribe Middleware in ITS
### Infrastructure
#### 4.1.1 Internet of Things (IoT) Infrastructure  
A key finding in our literature review is that all traffic surveillance infrastructure utilizes smart cameras (IoT devices) connected to a network for real-time data collection, processing, and transmission. Middleware solutions facilitate real-time data exchange, event-driven processing, and intelligent decision making, enabling advanced applications such as traffic monitoring, vehicle tracking, and incident detection. Researchers have proposed various middleware-based approaches integrating publish/subscribe messaging, distributed systems, and machine learning techniques to improve visibility, surveillance accuracy, and automated traffic management. This section explores how IoT-driven middleware has been applied to real-time traffic monitoring and ITS, highlighting its benefits, limitations, and evolving capabilities. [PERSON] et al. [46] designed a system to improve highway visibility, monitoring, and warnings utilizing video camera facilities in China. It provides real-time visibility data through image analysis and data fusion processes, which are transmitted and shared between the lower-end and upper-end subsystems using communication networks such as optical fiber and the internet. The lower-end subsystems capture and analyze video data for visibility information, and the upper-end was built on the J2 EE platform to provide essential services such as data transmission, data fusion, monitoring, alert, and data publish/subscribe mechanism. [PERSON] et al. [47] utilized real-time publish/subscribe middleware for wireless video surveillance of ITS. The authors designed it for traffic jam monitoring and vehicle tracking in transportation. The system uses wireless sensor nodes for event detection and a Wireless Mesh Network (WMN) for transmitting video streams. In terms of strengths, firstly, it reduces deployment expenses due to the wireless infrastructure, supports mobile users, and provides flexibility in defining and subscribing to events. Secondly, real-time data exchange is critical in ITS as it enables quick decision making, which improves traffic management, safety, and efficiency. Furthermore, [PERSON] et al. [48; 49] used Apache Kafka version 2.2, a distributed publish/subscribe messaging system, for real-time vehicle tracking using traffic monitoring cameras. In [48], it uses an Event-Based Microservice framework with synchronous and asynchronous communication. The microservices detect vehicles, extract their type, color, and speed features, and store them in a metadata repository. After that, the system publishes these features as events while other microservices subscribe to them. This results in a combination of all possibilities (type-color, type-speed, color-speed, type-color-speed) for vehicle identification. The system can return the best-matched vehicles based on user-selected features without re-processing the videos. Real-time information filtering is supported, and new microservices integration with the current system is possible. The system's strength comes from utilizing traffic cameras to optimize vehicle tracking and monitoring and hybrid communication using both synchronous and asynchronous methods for versatility. Its weaknesses come from requiring constant data from traffic cameras,which means dependence on continuous data flow. Also, a large amount of vehicle data might lead to processing challenges. Recently, the system was improved using a docker-container-based framework of the Apache Kafka node ecosystem for vehicle tracking [49]. The system follows three steps: (1) use You Only Look Once version 3 (YOLOv3) [50] to localize the license plate, (2) use Tesseract OCR character recognition with Optical Character Recognition (OCR), and (3) transmit the detected license plate using Kapka. This process increases scalability and improves user experience by allowing users to textually search the license plate and start and end time while Kapka retrieves the visual data and the system OpenCV library to compile and produce a video of the event.