We know that tight coupling between components can create maintenance issues in an application, issues where a small change in one component can have an impact on other associated (or coupled) applications. Messaging therefore provides an extremely valuable facility for allowing distributed components to communicate in a loosely coupled fashion, thus improving the maintainability of an application.
Java provides the JMS package to allow Java applications to interact with messaging services. Common approaches to messaging include message queues and publish and subscribe message topics. The JMS package allows for interaction with both of these services, as we saw in this chapter.