How To Create Java Services Without Spring Bloat

When you can’t see the forest through the bells and whistles

Randal Kamradt Sr
Level Up Coding
Published in
10 min readMar 23, 2021

--

Photo by Andrew Coelho on Unsplash

I have been working on a series of microservices that simulate a used car intake platform and as of now, I have managed to avoid Spring. Spring is a great framework when you need one of everything, but sometimes you just need a simple service and don’t want a 20–30 second start-up time.

One of the reasons I like to do small simple services in JavaScript is its lack of overhead and boilerplate. In the world of microservices, smaller is always better, and I think the reason so many fail at achieving success with microservices is that they’re still building them like they would a monolith. Spring does a great job of connecting all the pieces of your monolith together, but if your service is truly a microservice, there’s just not that much assembly required and Spring is redundant.

Since I’m used to making simple REST-like services in JavaScript, I was pleasantly surprised to find that there is a Java library called Java Express that tries to emulate the JavaScript library Express. One problem with my used car intake platform is it doesn’t yet have an input or output service, so you have to create the input data with a test generator, and you can only confirm that things work by looking at the logs and directly…

--

--