#1 Messaging system over TCP in event-driven architecture (.NET)
Event-driven architecture (EDA) is a software architecture that is designed for communication between two different software components. The communication is controlled with events which are generated by different sources. These sources are sensors, user interfaces, software systems and others. At the same time, the events are processed by other software services.
In event-driven architecture, software components are not tightly coupled which means that they do not call the other software services directly. Oppositely, they talk to each other through the messaging system which is loosely coupled.
There are different tools and ways to prepare a messaging system for communication. We can list some as following:
So, today we talk about the ‘messaging system over TCP’ which is secure and lightweight. This is a good option because it does not use third part tools like RabbitMQ. Also, TCP protocol has lower overhead than HTTP protocol.
Let’s dive into the example.
Below I created two different console applications which communicate with each other over the IP address in the server. One of the applications is the Publisher which generates events, another one is Consumer which consumes the events.
Publisher application:
Consumer application: