What is a message broker?
Simply put, a message broker is a piece of middleware that facilitates (or brokers) communication between two systems. While this sounds minimalistic, this basic concept can be expounded on for use cases such as the producer-consumer pattern, among others. Given the versatility of this type of middleware, it can be tempting to add additional processing features. Knowing when to add functionalities, such as data enrichment or transformation, is key to preventing product lock-in with a particular broker.
By means of domain-driven design (DDD) standards, keeping the implementation flexible while staying prescriptive on the interface functionality will yield the most consistent results. While you may not encounter a domain project that has 10 different concrete implementations of a broker or even a repository, it's not uncommon to have a few different options available. Often, you will see implementation classes for not only brokers but at least one type...