
Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified
We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]
Recently I attended as a speaker at my second jDays, a great conference in a great venue in Gothenburg. jDays is a fantastic conference as it is small enough to easily meet people and network and discuss tech, while at the same time big enough to run multiple tracks so there is always a session on that you’ll be interested in.
I did two talks at jDays. The first was a talk I have ran before about JCache and Java EE, the slides for the talk are on Slideshare and the code is available on GitHub. And the video is also available:
The second talk I inherited from a colleague of mine, who was unable to attend, entitled “Java EE Microservices Platforms, which is best”. Now given the title I thought the obvious answer was Payara Micro 🙂 , so this left me with a dilemma, how to do a comparison session, that would be educational for the audience but unbiased, so I decided to let the code do the talking and implement the same microservice on three different platforms and walk the audience through the code so they could compare and contrast. The three platforms I chose were WildFly Swarm, Payara Micro and Spring Boot.
I chose to build a micro-service using real world data. Fortunately, in the UK the Government provides a number of Open Data resources I could use to build my microservice. I therefore chose a dataset that would be of profound interest to a conference in Sweden, I chose the UK’s planned roadworks database!
The architecture of my microservice was simple. First I wrote a Servlet to ingest the XML file from the Highways Agency into a MySQL database using JAXB and JPA. Then I wrote a RESTful service to query the data by road and region. This was implemented in Java EE for Payara Micro and WildFly Swarm and Spring for Spring Boot. You can get the code on GitHub. Now to be fair I am no expert in WildFly Swarm or SpringBoot so don’t criticise the code too much! I was pleasantly surprised at how fast I could pick up developing the Spring Boot service even though I’m a novice with Spring, I’m sure an experienced Spring developer can happily rip apart my Spring code. In a similar vein, I’m sure a WildFly Swarm expert can reduce my jar size. For the JavaEE microservice there were no code changes required to move between WildFly Swarm and Payara Micro, even the datasource definition in the web.xml ported across without change.
Once I had created the code I then set out to measure the file size, memory footprint and boot times of the various microservice jars created. The results of which are below.
Payara Micro | WildFly Swarm | Spring Boot | |
File Size | 60MB + 1MB war | 100 MB | 26 MB |
Boot Time | 4s | 4s | 4s |
Used JVM Heap (after full GC) |
34MB Metaspace 63MB |
35MB Metaspace 83MB |
44MB Metaspace 51MB |
You can draw your own conclusions from the source code and the table above about which platform you prefer. The standout conclusion for me is that all the platforms are lightweight, small footprint and fast.
Now I’m never going to convince a Spring developer to move to JavaEE however a developer who loves JavaEE can quite happily build microservices using the JavaEE apis and deploy with WildFly Swarm or Payara Micro. Stick with what you are familiar and most productive with.
Feel free to use my code as an example microservice and if you want to improve it just raise a pull request.
Share:
We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]
Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]
Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]
Why is tomee version 7 is not considered for comparision? Tomee is very good for building micro services
No specific reason, other than time, as it was a conference talk .
Datasource configuration is defined in web.xml (hostname and port). If we are moving our application from one environment to another say from UAT to Production how will we change the datasource details?
For Payara Micro you can use system property replacement to change the values.
TomEE (7.0.0-M3) fatjar makes ~37M, boots in 3s locally (but not sure it means anything since we don’t have the same PC and pby OS – i Used windows).
Also removed activemq from default dependencies (to gain half of the size) and put web resources in META-INF/resources. Finally removed the datasource from web.xml to test quickly but guess this quick test allows to add tomee in the landscape.
Here is the pom (instruction to build the module forking payara one are at the top): https://gist.github.com/rmannibucau/beeae9387722d87b0f3e8ecc224c0ade
Cool contribution. I can add to the project or you can raise a pull request.