Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing the Order Management Messaging System with SpringJMS and ActiveMQ


In the preceding section about Apache ActiveMQ, we discussed the steps required to create a message queue and created an order queue. Now, let's send messages to the queue from the application.

The following table depicts the components of the application with JMS integrated with it.

The request flows from JSP to a Spring controller, which sets the order bean object and sends it orderSender (which is a JMS message sender class). The class puts the order object in the queue.

The JMS Receiver is the class which reads from the queue. The read object is sent to the OrderRepository class, which is a Mongo Repository class, and posts the messages to the MongoDB database.

The following table gives us an overview about the classes used to communicate with JMS with a Spring MVC application:

JSP

Controller

Bean

JMS sender

JMS receiver

MongoRepository

order.jsp

allorders.jsp

Order Controller.java

Order.java

...