Message sender

The message sender we will demonstrate is based on the HTTP server implementation we demonstrated in the Microservices section. It is not necessary to do it this way. In real-life code, a vertical typically sends messages automatically, either to get data it needs, to provide data some other vertical wants, to notify another vertical, to store data in the database, or for any other reason. But for demonstration purposes, we have decided that the sender will listen to some port for messages, and we will send it messages manually (using the curl command) or automatically, via some periodic service described in the Microservices section. That is why the message sender looks a bit more complex than the message consumer:

package ...

Get Introduction to Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.