Xóa bài viết
Bạn có chắc chắn muốn xóa bài viết này không ?
Xóa bình luận
Bạn có chắc chắn muốn xóa bình luận này không ?
How to use Spring JMS with ActiveMQ – JMS Consumer and JMS Producer | Spring Boot
How to use Spring JMS with ActiveMQ – JMS Consumer and JMS Producer | Spring Boot
Spring JMS (Java Message Service) is a powerful mechanism to integrate in distributed system.
ActiveMq is a Java Open Source, it is simple JMS solution for concurrent, consumers and producers architecture in integrated development.
The tutorial will guide you how to build a simple application with Spring JMS, ActiveMQ.
Related Articles:
- Apache Artemis – How to produce/consume JMS messages with SpringBoot Artemis applications.
- ActiveMQ – How to create a SpringBoot ActiveMQ Response Management application by @SendTo annotation
- How to start Spring Apache Kafka Application with SpringBoot
- Spring Jms ActiveMq – How to send Java object messages to ActiveMQ server (specially with Bi-Directional relationship Java objects)
- ActiveMq – How to work with Spring JMS ActiveMq Topic (Publisher-Subcribers pattern) using SpringBoot
I. Technology
- Java 1.8
- Maven 3.3.9
- Spring Tool Suite – Version 3.8.1.RELEASE
- Spring Boot: 1.4.0.RELEASE
- ActiveMQ 5.14.0
- Docker 1.12.0
II. Overview
1. Goal
Our goal is to build an application that receives processing message request from REST Client, in our case, a browser, then use Spring JMS API with Jms Template for JMS Producer and JMS Customer, via Connection Factory to interact with ActiveMQ which is run by Docker, and return the response message to Client.
2. Project Structure
- application.properties to configure ConnectionFactory
- JmsProducer and JmsConsumer autowired JmsTemplate
- interface JmsClient with 2 methods: send and receive.
- implementation of JmsClient autowired JmsProducer, JmsConsumer, JmsClient should be autowired in WebController and will be used to implement method send/receive message.
- WebController is a RestController which has request mapping method for RESTful request, such as produce and receive.
-
Dependencies for Spring Boot Web, JMS and ActiveMQ are added in pom.xml
3. Step to do
- Create Spring Boot project & add Dependencies - Set up ConnectionFactory - Create JMS Consumer and JMS Producer - Create JMS Client - Create a Web Controller
- Run ActiveMQ by Docker
- Run Spring Boot Application & Enjoy Result
4. Demo Video
More at:
How to use Spring JMS with ActiveMQ – JMS Consumer and JMS Producer | Spring Boot
Bình luận

{{ comment.user.name }}
Bỏ hay
Hay

Cùng một tác giả

1
0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...

1
0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...

1
0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
Bài viết liên quan

0
0
Angular 6 + SpringBoot RestAPIs + ActiveMQ Producer/Consumer example https://grokonez.com/frontend/angular/angular6/angular6springbootrestapisacti...