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 ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access