Chapter 7. Creating Java applications with ActiveMQ
This chapter covers
- Embedding ActiveMQ in Java applications
- Embedding ActiveMQ using Spring
- Creating request/reply applications
- Writing JMS clients using Spring
Thus far the book has concentrated on ActiveMQ as a software application. Most of the information we’ve presented has concerned the internal structure of ActiveMQ and how its components can be configured. But apart from basic JMS examples, using ActiveMQ in your applications hasn’t been discussed. This chapter is dedicated to explaining how to create applications with ActiveMQ.
One of the things you might want to do with ActiveMQ is to embed it into your application. Since ActiveMQ is written in Java, it can naturally be integrated in another Java application. As you’ll see, you can configure the broker using either Java code or XML (via the Spring Framework). A fully configured broker can serve clients from the same application (using the VM protocol) as well as clients from remote applications to exchange messages over the network. This scenario is depicted in figure 7.1.