The field of cyber-physical systems is a growing IT research area that addresses the deep integration of computing, communication and process control, possibly with humans in the loop. The goal of such area is to define modelling, controlling and programming methodologies for designing and managing complex mechatronics systems, also called industrial agents. Our research topic mainly focuses on the area of data mining and analysis by means of multi-agent orchestration of intelligent sensor nodes using internet protocols, providing also web-based HMI visualizations for data interpretability and analysis. Thanks to the rapid spreading of IoT systems, supported by modern and efficient telecommunication infrastructures and new decentralized control paradigms, the field of service-oriented programming finds new application in wireless sensor networks and microservices paradigm: we adopted such paradigm in the implementation of two different industrial use cases. Indeed, we expect a concrete and deep use of such technologies with 5G spreading. In the article, we describe the common software architectural pattern in IoT applications we used for the distributed smart sensors, providing also design and implementation details. In the use case section, the prototypes developed as proof of concept and the KPIs used for the system validation are described to provide a concrete solution overview.