Received April 14, 2021, accepted May 26, 2021, date of publication June 3, 2021, date of current version June 15, 2021. Digital Object Identifier 10.1109/ACCESS.2021.3085736 Event-Based Microservices With Apache Kafka Streams: A Real-Time Vehicle Detection System Based on Type, Color, and Speed Attributes SEDA KUL , ISABEK TASHIEV, ALI ŞENTAŞ, AND AHMET SAYAR Department of Computer Engineering, Kocaeli University, 41001 Kocaeli, Turkey Corresponding author: Seda Kul (seda.kul.06@gmail.com) This work was supported by the TUBITAK under Grant 116E202. ABSTRACT The work presented in this paper proposes a novel approach to tracking a specific vehicle over the video streams published by the collaborating traffic surveillance cameras. In recent years, smart, effective transportation systems and intelligent traffic management applications are among the topics that have been given importance by various institutions. Developing a scalable, fault-tolerant, and resilient traffic monitoring system that retrieves video chunks with the desired query is challenging. For these challenging problems, stream processing and data retrieval systems have been developed over the years. However, there are still existing shortcomings between users and retrieval systems. This paper investigates the problem of retrieving video chunks by key-value query based on publish/subscribe model. Thus, we propose a hybrid of an asynchronous and synchronous communication mechanism for the Event-Based Microservice framework. We aim to develop generic techniques for better utilization of existing platforms. In the proposed framework, (i) first of all, microservices detect vehicles and extract their type, color, and speed features, and stored them in the metadata repository. (ii) Microservices publish each feature as events (iii) Other microservices self-join subscribe to those events, which leads to more events being published by combing all the possibilities: type- color, type-speed, color-speed, and type-color-speed. Finally, (iv) the system visualizes the query result and system status in real-time. When the user has selected color or/and a type or/and a speed feature, the system will return the best-matched vehicles without re-processing the videos. Experimental results show that our proposed system filters messages in real-time and supports easy integration of new microservices with the existing system. INDEX TERMS Intelligent transportation system (ITS), microservices, publish-subscribe system, stream computing, vehicle detection. I. INTRODUCTION Intelligent Transportation System (ITS) is becoming perva- sive and actively used in recent years to increase traffic effi- ciency, decrease traffic congestion, and provide road safety. ITS uses communication technologies such as various sensors and cameras to produce useful information for operators. Implementing electronics, wireless and communication tech- nologies on roads is costly. Therefore, surveillance camera systems such as Closed-circuit television (CCTV) and IP cameras have become widespread and actively used. The operators monitor surveillance camera feeds in real-time or recorded video. The need for access to up-to-date, accurate, and relevant data increases day by day. For this reason, how to The associate editor coordinating the review of this manuscript and approving it for publication was Razi Iqbal . retrieve and distribute live video surveillance streams to users as per their interest promptly is one of the biggest challenges. Current video retrieval studies are mostly based on Text- based and Content-based indexing methods. Content-Based image retrieval (CBIR) is also known as query by image. In the CBIR method, the system extract features from each image and stores them in a database. When the user queries an image, the feature vector of the query image is extracted. The similarity between the feature vector of the query image and images in the database is measured. However, this makes it very slow to be used in real-time [1] due to working with the high dimensional vectors. Then, the system returns the images that most closely resemble the query image [2]. Unlike CBIR, the Text-Based Image Retrieval (TBIR) method annotates the images with file name, image size, dimension, and format. Then, it stores them in a database [3]. VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ 83137