Playback starts YouTube’s embedded player (privacy-enhanced mode).
Spring Boot JMS Tutorial - JmsTemplate JmsListener with ActiveMQ Example & JAXB
ChannelPhilip StarrittChapters
Description from the creator
In this Java Spring JMS Example I show you how to use Spring Boot JMS Autoconfiguration in order to create a JMS producer and JMS consumer.
We first create a JMS publisher application by injecting the Spring Boot JmsTemplate autoconfiguration with a MarshallingMessageConverter and ActiveMQ connection factory (also autoconfigured). The MarshallingMessageConverter contains a Jaxb2Marshaller with its context path, schema and pretty print values set. The context path is equal to the package that contains the JAXB generated objects.
I then create a JMS consumer application by configuring a MarshallingMessageConverter backed by a Jaxb2Marshaller. The ActiveMQ connection factory will also be autoconfigured in the consumer. Once these are configured, Spring Boot will automatically create a JmsListenerContainerFactory and associate our defined beans (Above). We can then use the @JmsListener annotation to read of a target message queue. See spring documentation 13.1.6 for more information.
The publisher will automatically convert & marshall the JAXB object into XML before sending it to the ActiveMQ message queue. The consumer will additionally automatically unmarshal the XML into the JAXB object.
0:00 – 01:15 Tutorial overview
00:15 – 01:42 Create maven dependency for shared JAXB Objects.
01:42 – 02:55 Maven JAXB plugin – Generate JAXB objects from XSD
02:55 – 03:45 Create Jms Publisher Spring Starter Project
03:45 – 04:40 Analyse Spring Boot JmsAutoConfiguration JmsTemplate
04:40 – 06:30 Set Spring Boot ActiveMQ autoconfiguration & application properties
06:30 – 10:00 Configure MarshallingMessageConverter and Jaxb2Marshaller. Set the context path, enable schema validation and XML pretty print
10:00 – 12:35 Send Message to ActiveMQ queue via JmsTemplate. Start ActiveMQ Message Broker via Windows Command Prompt
12:35 – 14:30 Debug and analyse objects to show spring boot autowiring
14:40 – 15:40 Create Jms Consumer Spring Starter Project & configure maven dependencies
15:40 – 16:36 Configure Jms consumer MarshallingMessageConverter and Jaxb2Marshaller. Set the context path, enable schema validation and XML pretty print
16:36 – 16:45 Remove AMQP dependency from Publisher (brought in my accident)
16:55 – 17:15 Add @EnableJms to the spring configuration
17:15 – 18:50 Add @JmsListener annotation to read and process messages of the ActiveMQ
18:50 – 19:40 Turn on JMS consumer and consume XML message. Automatically convert XML into JAXB object.
19:40 – 20:10 Turn on publisher and send another message to consumer
20:10 – 20:17 Tutorial summary
If you enjoyed the tutorial please subscribe for regular Software Tutorials! :)
Enjoy!
Philip
Spring Framework JMS Example
Apache Camel Alternative Tutorial: youtube.com/watch?v=B-Q_InvRvn0
Jaxb2Marshaller Tutorial: youtube.com/watch?v=0D-P2LzLJYQ
Spring Boot Messaging Features: docs.spring.io/spring-boot/docs/current/referen…
Spring Framework JMS Integration: docs.spring.io/spring/docs/current/spring-frame…
JmsTemplate: docs.spring.io/spring-framework/docs/current/ja…
ActiveMQ: activemq.apache.org/
ActiveMQ Spring Support: activemq.apache.org/spring-support.html
Spring JMS ActiveMQ Example
We first create a JMS publisher application by injecting the Spring Boot JmsTemplate autoconfiguration with a MarshallingMessageConverter and ActiveMQ connection factory (also autoconfigured). The MarshallingMessageConverter contains a Jaxb2Marshaller with its context path, schema and pretty print values set. The context path is equal to the package that contains the JAXB generated objects.
I then create a JMS consumer application by configuring a MarshallingMessageConverter backed by a Jaxb2Marshaller. The ActiveMQ connection factory will also be autoconfigured in the consumer. Once these are configured, Spring Boot will automatically create a JmsListenerContainerFactory and associate our defined beans (Above). We can then use the @JmsListener annotation to read of a target message queue. See spring documentation 13.1.6 for more information.
The publisher will automatically convert & marshall the JAXB object into XML before sending it to the ActiveMQ message queue. The consumer will additionally automatically unmarshal the XML into the JAXB object.
0:00 – 01:15 Tutorial overview
00:15 – 01:42 Create maven dependency for shared JAXB Objects.
01:42 – 02:55 Maven JAXB plugin – Generate JAXB objects from XSD
02:55 – 03:45 Create Jms Publisher Spring Starter Project
03:45 – 04:40 Analyse Spring Boot JmsAutoConfiguration JmsTemplate
04:40 – 06:30 Set Spring Boot ActiveMQ autoconfiguration & application properties
06:30 – 10:00 Configure MarshallingMessageConverter and Jaxb2Marshaller. Set the context path, enable schema validation and XML pretty print
10:00 – 12:35 Send Message to ActiveMQ queue via JmsTemplate. Start ActiveMQ Message Broker via Windows Command Prompt
12:35 – 14:30 Debug and analyse objects to show spring boot autowiring
14:40 – 15:40 Create Jms Consumer Spring Starter Project & configure maven dependencies
15:40 – 16:36 Configure Jms consumer MarshallingMessageConverter and Jaxb2Marshaller. Set the context path, enable schema validation and XML pretty print
16:36 – 16:45 Remove AMQP dependency from Publisher (brought in my accident)
16:55 – 17:15 Add @EnableJms to the spring configuration
17:15 – 18:50 Add @JmsListener annotation to read and process messages of the ActiveMQ
18:50 – 19:40 Turn on JMS consumer and consume XML message. Automatically convert XML into JAXB object.
19:40 – 20:10 Turn on publisher and send another message to consumer
20:10 – 20:17 Tutorial summary
If you enjoyed the tutorial please subscribe for regular Software Tutorials! :)
Enjoy!
Philip
Spring Framework JMS Example
Apache Camel Alternative Tutorial: youtube.com/watch?v=B-Q_InvRvn0
Jaxb2Marshaller Tutorial: youtube.com/watch?v=0D-P2LzLJYQ
Spring Boot Messaging Features: docs.spring.io/spring-boot/docs/current/referen…
Spring Framework JMS Integration: docs.spring.io/spring/docs/current/spring-frame…
JmsTemplate: docs.spring.io/spring-framework/docs/current/ja…
ActiveMQ: activemq.apache.org/
ActiveMQ Spring Support: activemq.apache.org/spring-support.html
Spring JMS ActiveMQ Example
About this tutorial
Philip Starritt published this 21:18 video tutorial on October 31, 2016. It has been watched 30,955 times on YouTube.
- Channel
- Philip Starritt
- Category
- Education
- Duration
- 21:18
- Published
- October 31, 2016
- Views
- 30,955
- Likes
- 193
Tags
Share
This tutorial in other languages
- FRSpring JMS Boot Tutorial - JmsTemplate JmsListener avec ActiveMQ Exemple & JAXB
- ESPrimavera de arranque JMS Tutorial - JmsTemplate JmsListener con ActiveMQ Ejemplo y JAXB
- PTPrimavera Bota JMS Tutorial - JMSTemplate JmsListener com ActiveMQ Exemplo & JAXB
- ITPrimavera Boot JMS Tutorial - JmsTemplate JmsListener con ActiveMQ Esempio & JAXB
- DEFrühlings-Boot-JMS Tutorial - JmsTemplate JmsListener mit ActiveMQ Beispiel & JAXB
- NLSpring Boot JMS Tutorial - JmsTemplate JmsListener met ActiveMQ Voorbeeld & JAXB
- RUSpring Загрузочный JMS Учебник - JmsTemplate JmsListener с ActiveMQ Примеру и JAXB
- PLWiosna Boot JMS Tutorial - JmsTemplate JmsListener z ActiveMQ Przykładzie JAXB
- JA春ブーツJMSチュートリアル - ActiveMQの例&JAXBとJmsTemplate JmsListener
- ARربيع التمهيد الدائرة دروس - JmsTemplate JmsListener مع ActiveMQ مثال وJAXB
- HIस्प्रिंग बूट JMS ट्यूटोरियल - ActiveMQ उदाहरण और JAXB साथ JmsTemplate JmsListener
- IDSemi Boot JMS Tutorial - JmsTemplate JmsListener dengan ActiveMQ Contoh & JAXB