Вопрос

I use Tomcat in production.

Are Jetty and Winstone (https://stackoverflow.com/questions/1515654/what-is-a-lightweight-fast-java-servlet-container) suitable for production use?

I'm happy to let go of features in return for simplicity. Servlets and filters are probably sufficient and the server isn't heavily loaded, so interested to experiment with running it on a minimalist platform. Sticking with Tomcat is also fine.

Это было полезно?

Решение

RE: Jetty

  • Short Answer: Yes

  • Long Answer: Yes, of course...many companies use jetty in production, either in its distribution form or embedded into their applications. In fact, I just updated this jetty powered page on the eclipse site.

http://www.eclipse.org/jetty/powered/

The about page with some additional info:

http://www.eclipse.org/jetty/about.php

and finally a 'Why Choose Jetty?' link:

https://www.webtide.com/choose/jetty.jsp

Другие советы

Another one to consider is Undertow by JBoss. It's lightweight and easy to get started with. Supports servlets and both blocking and non-blocking io.

You may consider using ActiveJ Java platform as it focuses on simplicity and minimalist approach:

ActiveJ was built from the ground up, so it doesn’t feature tons of abstractions hiding the legacy standards. It is minimalistic, boilerplate-free, and incomparably fast, which is proven by benchmarks.

public final class HttpHelloWorldExample extends HttpServerLauncher {
    @Provides
    AsyncServlet servlet() {
        return request -> HttpResponse.ok200().withPlainText("Hello World");
    }

    public static void main(String[] args) throws Exception {
        Launcher launcher = new HttpHelloWorldExample();
        launcher.launch(args);
    }
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top