Spring Boot vs. JAX-RS (Restlet) for dead simple microservice
I want to build a really small self-contained microservices serving some REST operations storing the data in memory (no persistence required).
Hence, I am looking framework-wise for the most lightweight approach. After looking into an available JAX-RS implementations Restlet seemed to be a good choice.
Also got Spring Boot recommended with the comment you don't need JAX-RS. I got a bit confused. Isn't JAX-RS the standard for Java REST applications? Wouldn't I need to combine Spring Boot with JAX-RS anyway?
They're completely different beasts and both of them can be useful to you in their own way.
Spring boot perfectly supports Rest services. Spring boot shines because you can create a rest service literally in 5-6 lines of code.
Spring boot will:
handle web container (it has tomcat/jetty embedded, although you might opt for wars to be deployed externally as well)
Handle all the dependencies (version compliance and so force). It also means JSON manipulation framework and not just the way of declaring REST endpoints. Spring boot uses Jackson by default.
Handle all the hassle of packaging everything. If you work with WAR it can be less interesting (of course, in this case you'll have to think about the web-container and spring boot does it for you). But you work with Jars - spring boot will create one big jar that just can be loaded with java -jar <youjar>.
Optionally providing a metrics and JMX stuff for your application - just declare a maven/gradle dependency on actuator and you're ready to go.
All this makes spring boot perfect for developing self-contained microservices which might be your case.
On the opposite If you're looking for framework to provide rest on your existing solution, than probably you won't use spring boot. Maybe you're not using spring at all, who knows?
So I would say, that Jersey/Restlet and so forth are just Web frameworks for easier development of REST services in Java. And spring boot is more about managing your application, of course it provides also a way of working with REST services just like it provides a way of working with JDBC, Servlet API and so forth.
Hope this helps
JAX-RS is part of the Java EE specification and the standard REST API for application servers, which implement the Java EE specification. Each application server usually comes with it's own implementation, let it be RestEasy for Wildfly, Jersey, Wink etc. It doesn't mean, that every Java framework which supports REST, has to implement JAX-RS. That said, Restlet is not a JAX-RS implementation, it's a completely independent framework (as Spring MVC with its REST capabilities is, which would be used by default by Spring Boot).
You can also develop a Spring Boot application with JAX-RS for REST, Spring Boot provides starter POMs for Jersey and also autoconfiguration to minimize your own configuration efforts.