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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
  1. DZone
  2. Coding
  3. Java
  4. JMS and Async, Don't Mess With It

JMS and Async, Don't Mess With It

Dinuka Arseculeratne user avatar by
Dinuka Arseculeratne
·
Dec. 27, 12 · Interview
Like (0)
Save
Tweet
Share
13.02K Views

Join the DZone community and get the full member experience.

Join For Free

JMS stands for Java Message Service which is an API which is used by middleware service providers such as ActiveMQ, JBoss MQ, Rabbit MQ, etc. Its main purpose is to allow disparate systems to communicate based on a common platform. Which means that if I have my front end written in .Net and my back end written in Java for example, one way of communicating between the two (other than Webservices etc) is to use a JMS provider in a publisher-subscriber or peer-to-peer configuration.

In our own project we have used JMS not to communicate between two disparate systems but to get the asynchronous capability integrated to our application. What we do is push the message into a queue and get along with the rest of the business process. But it seems this is not the correct way of achieving this. Of course at the end of the day we have achieved asynchronous behavior, but not in the right way. A solution just came to light when Spring 3 was released. Spring 3 provided an implementation allowing asynchronous capability with the @Async annotation. I will not go into the details of this feature as it is very well explained here.

I have changed the previously JMS oriented code which mimicked the asynchronous capability and introduced Spring's Async implementation because I felt it was much cleaner and reduced all handling i needed to do with onMessage(),Connection Factory and the rest of the code needed to deal with JMS queues and topics.
Java Message Service Peer-to-peer Implementation Java (programming language) Spring Framework application Factory (object-oriented programming)

Published at DZone with permission of Dinuka Arseculeratne, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Factors When Selecting a Database
  • Agile Transformation With ChatGPT or McBoston?
  • Mind Map Reuse in Software Groups
  • Utilize OpenAI API to Extract Information From PDF Files

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: