DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Setup ActiveMQ Artemis on Windows
  • Apache Cassandra Horizontal Scalability for Java Applications [Book]
  • Deep Dive Into JMS Integration Patterns With MuleSoft and JMS Behavior With Anypoint Clustering and Server Groups
  • The Ultimate Guide to React Dashboards Part 1: Overview and Analytics

Trending

  • Integrating Security as Code: A Necessity for DevSecOps
  • Medallion Architecture: Why You Need It and How To Implement It With ClickHouse
  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • Beyond ChatGPT, AI Reasoning 2.0: Engineering AI Models With Human-Like Reasoning
  1. DZone
  2. Data Engineering
  3. Databases
  4. How to Use JMS ActiveMQ With Mule 4: Part 1

How to Use JMS ActiveMQ With Mule 4: Part 1

In this blog, we will see what is JMS, why it is used, what different features are provided by JMS, and how we can install JMS ActiveMQ on our system.

By 
Anand Joshi user avatar
Anand Joshi
·
Aug. 12, 21 · Tutorial
Likes (7)
Comment
Save
Tweet
Share
18.3K Views

Join the DZone community and get the full member experience.

Join For Free

What is JMS?

JMS (Java Messaging System) is mostly used to enable the communication between APIs using an exchange of messages. It provides loosely coupled, reliable and asynchronous communication.

ActiveMQ is an open-source protocol developed by Apache which functions as an implementation of message-oriented middleware (MOM). Its basic function is to send messages between different applications.

A messaging system is composed of a JMS Broker (middleware), Queues and Topics, Producers, and Consumers.

JMS Broker is an application server that sits in between the sender (producer) and receiver (consumer). JMS Broker receives messages from producers and sends messages to consumers. It means that a Message sent from the Producer is not directly received by the consumer, instead, it is first received by the Broker and after receiving a message, the broker forwards the message to consumers.

JMS producer (sender) is an entity that creates and sends messages to JMS Queue or topic.

JMS consumer (receiver) is an entity that receives messages from the JMS queue or topic.

Using JMS we can send messages to queue or topic. Now let's understand what they are and why they are used.

Queue

Topic

Used for point to point OR 1 to 1 communication.

Used for one to many communication OR Pub-sub communication.

A message published to a queue can only be consumed by only one subscriber/receiver.

A message published to a topic can be consumed by any number of subscribers.

The receiver doesn’t need to listen to the queue at the time the message is sent.

A subscriber will miss the published message if it is not actively listening to the topic. (Unless the topic is made durable.)

Advantages of JMS

  1. Loosely Coupled
  2. Asynchronous 
  3. Reliable
  4. Scalability

How to Setup JMS Active MQ (On Local)

  1. Download the ActiveMQ from the below link: https://activemq.apache.org/components/classic/download/
  2. After successful download, move it to the location where you want to keep ActiveMQ and Unzip it.
  3. After unzip, open the cmd and move to the path where you unzipped ActiveMQ then go to the bin folder.
  4. Run the command activeMQ start to start ActiveMQ: Running activeMQ start
  5. Open the ActiveMQ console by going to the link:  http://localhost:8161/admin/
  6. It will ask for a username and password. The default username is 'admin' and the password is 'admin'.Entering Default Username and Password
  7. On successful login, the JMS console would be shown like below. JMS Console on Successful Login
  8. We can create a Queue by clicking on Queues.  We need to Enter the name of the queue, that we want to create. Here we are giving the name of the queue as testQueue1. Creating a Queue
  9. We can see that the queue named testQueue1 has been created in ActiveMQ. testQueue1 Created in ActiveMQ
  10. The creation of a topic in JMS is very easy. On the JMS console, we need to click on the topic. Creating a Topic
  11. We need to write the name of the JMS topic which we want to create and then click on Create option.  Naming Topic: testTopic1
  12. After clicking on create, we can see that testTopic1 is added to the topic list.testTopic1 on Topic List

This is how we can create Queue and Topic from the JMS console. In the next part, we will see how we can use JMS ActiveMQ in Mulesoft.

Open source consumer Relational database Console (video game CLI) producer Application server application Links Download

Opinions expressed by DZone contributors are their own.

Related

  • Setup ActiveMQ Artemis on Windows
  • Apache Cassandra Horizontal Scalability for Java Applications [Book]
  • Deep Dive Into JMS Integration Patterns With MuleSoft and JMS Behavior With Anypoint Clustering and Server Groups
  • The Ultimate Guide to React Dashboards Part 1: Overview and Analytics

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!