Implementing a sample microservices application
We can use the Mosca, MongoDB, and Redis containers, along with a couple of custom containers, to implement a simple but complete application:
The publisher and subscriber will communicate with each other using MQTT. The subscriber will listen for a handful of MQTT topics that direct it to operate on or retrieve information from the MongoDB and Redis databases. The publisher will send these MQTT topics and print the responses.
The publisher will be based on Node.js version 11 and the subscriber will be based on Node.js version 12. Without Docker or a virtual machine, running two Node.js versions on the same machine concurrently requires the use of Node Version Manager (nvm) and having multiple versions of Node.js installed on your workstation. Docker containers make it simple to use as many versions as you need and to package the version...