Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Spring Application Development

You're reading from   Mastering Spring Application Development Gain expertise in developing and caching your applications running on the JVM with Spring

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781783987320
Length 288 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Anjana Mankale Anjana Mankale
Author Profile Icon Anjana Mankale
Anjana Mankale
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Spring Mongo Integration FREE CHAPTER 2. Messaging with Spring JMS 3. Mailing with Spring Mail 4. Jobs with Spring Batch 5. Spring Integration with FTP 6. Spring Integration with HTTP 7. Spring with Hadoop 8. Spring with OSGI 9. Bootstrap your Application with Spring Boot 10. Spring Cache 11. Spring with Thymeleaf Integration 12. Spring with Web Service Integration 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.

Implementing the Order Management Messaging System with SpringJMS and ActiveMQ

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image