Standalone Messaging Model

The TradesLoader component can be refactored to do its job of loading the Trades from a file. In order to complete its task, the TradesLoader will publish the Trades to a data-holding structure like a bucket. In Messaging terms, this is called a destination or a channel. The rest of the components should be picking up the Trades from this channel, which acts as a conduit.

Note that we did not introduce a full-blown enterprise messaging solution here. It would be overkill, because it would introduce a whole stack of infrastructure and open doors to different programming models.

See Figure 1-2, which depicts a sort of parallel process using a standalone messaging model.

Standalone Messaging

Figure 1-2. Standalone Messaging

The Spring Integration framework is an excellent choice for this type of messaging solution. If you are already familiar with Spring Framework or if your project is already springified, then you are in good hands. Spring Integration is perceived as an extension of the Spring Core, so you will obtain all the benefits of dependency injection, decoupling, testability, etc. You do not need to have an application server to host your messaging solution when you use Spring Integration—which is a big advantage, as you don’t have to invest time and money in adopting the messaging technologies.

We will look at the framework in detail in the next chapter.

Get Just Spring Integration 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.