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. True Power of Java EE and JMS: Distributed Computations!

True Power of Java EE and JMS: Distributed Computations!

Łukasz Budnik user avatar by
Łukasz Budnik
·
Feb. 18, 13 · Interview
Like (0)
Save
Tweet
Share
6.29K Views

Join the DZone community and get the full member experience.

Join For Free

Back in 2011 I was writing a PhD about evaluating and measuring quality of Web Services compositions. I had a system where I focued on evaluating WS-BPEL processes (but the framework I designed was extremely flexible and supports any business scenario technology).

The system (called Measurement System DIES) is a Java EE application. It is designed in a distributed manner which makes scaling out and distributing computations very easy.

Out of pure curiosity, I decided to do stress tests. Apache Geronimo did not survive this nor did the embedded ActiveMQ. After I killed Geronimo and started it again all queues stopped working... I had to install brand new instance of Geronimo.

But thanks to Java EE capabilities and the distributed nature of my system I was able to overcome this problem. See how I did it with JMS and distributed computations!

The EJB module of my application

Most of the work performed by my system is done, of course, in EJB module. The EJB module of my application consists of the following (among many other things of course):

  • Queue for execution orders - each execution of a WS-BPEL process instance may last minutes (I have a 10 minutes timeout set up),
  • Queue for asynchronous computing of quality and performance score of each activity trace - this task usually takes up to 4 seconds to complete (most of the time spent here is to query external services like geolocation services),
  • Timer for computing statistics - every 10 seconds I retrieve all completed instances which are not yet analysed and conduct some statistical computations.

The development environment


While developing my system I used 1 box  for everything:

  1. Apache Geronimo with my Java EE application and embedded ActiveMQ server
  2. Apache ODE as an WS-BPEL execution engine
  3. IBM DB2 pureXML

New Machine(s)

I managed to get a second machine. Based on that I decided to distribute my components this way:

1st computer:
  1. Apache Geronimo with my Java EE application with Timer but without Queue components
  2. IBM DB2 pureXML
  3. Apache ODE as an execution engine
2nd computer:
  1. Apache Geronimo with EJB module with Queue components
  2. Standalone ActiveMQ
Ideally I would need 2 more machines:
  • 3rd for IBM DB2 pureXML database
  • 4th for Apache ODE
But having 2 machines was enough.

Distributing components

Here is what I did:

  1. I split my EJB components. I moved my two queues into a separate project and deployed them to Apache Geronimo installed on the second machine. I decided to leave the Timer component in the original EJB project.
  2. I downloaded a standalone ActiveMQ server and installed it on the second machine.
  3. Finally I configured connection factories for both Apache Geronimos. I used the wizard offered by Geronimo's Admin Console - it was childishly simple! I use application-wide JMS resources and just compared the generated deployment plans with the ones I already had. It turned out that I had to add 1 line to my deployment plans - the external server url. NICE! This is how the enterprise configuration should look like!
Rerunning the stress test again

I re-ran my stress test. Both Geronimos and ActiveMQ survived :)

What was the improvement rate? Hard to say... In Java when you add, subtract, multiply or divide NaN by any other number you still get NaN. I know one thing for sure, the first configuration did not survive the stress test :)

Conclusions

Always keep in mind that some day your system will have to be distributed or scaled out. At the design stage it's far more easier to introduce basic enterprise architectural patterns and concepts than to introduce them during the maintenance phase (when, for example, task distribution would have a huge impact on the whole system).

cheers,
Łukasz
Java EE Java (programming language) Apache Geronimo IBM DB2 application Machine Execution (computing) Testing PureXML

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Problems of Cloud Cost Management: A Socio-Technical Analysis
  • A Simple Union Between .NET Core and Python
  • Top 5 PHP REST API Frameworks
  • Top 10 Secure Coding Practices Every Developer Should Know

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: