It would be good for spring-boot to provide support for embedded Grizzly Container
Can you provide some more details please? Specifically, exactly what support would be good? As far as I can tell, Grizzly isn't a viable option as a servlet container:
This is not a Servlet compliant implementation and as such, not all features exposed by a typical Servlet container are available here.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Hello @wilkinsona
I have been very busy lately.
We have been using Grizzly with Jersey in prod for many years now.
Recently, we have been looking into Spring boot ... and as Boot does not support Grizzly, I started comparing Grizzly to the supported containers
I have done some performance benchmarks and the result is summarized in the two blog entries at:
Feel free to run the tests on you rmachine.
Grizzly seems to perform better than any of the other containers.
Given that Grizzly is the container behind Glassfish, it can become a fully fledged Servlet Container by adding the proper jar dependencies.
As stated earlier, it's just a matter of adding the appropriate Jars to make it work with Spring Web MVC.
I would suggest we start with a minimal working contribution first, then we add support for JSP and others later?
Given the performance gain for REST Services, I believe that support for Grizzly would be very beneficial to the community
@arcadius Interesting research. Thank for sharing your findings.
Assuming that I have understood things correctly, you are using a Grizzly-specific adapter for Jersey which allows it to run directly on top of Grizzly. This is in contrast to the setup that you have for Jetty, Tomcat, and Undertow where Jersey is running on top of the servlet container. If this is right, then I'm not surprised to see the Grizzly-based app outperform the other three. It would be interesting to see how Grizzly compares with the other containers once it's "become a fully fledged Servlet Container by adding the proper jar dependencies".
My feeling at the moment is that auto-configuration support for Grizzly that requires the use of a Grizzly-specific adapter for something like Jersey is too specialised. If it supported the complete Servlet spec then that would significantly broaden its appeal.
Any changes here also need to be considered in the light of the work that's being done on Spring Reactive. Spring Reactive's web support won't require a servlet container so Grizzly support becomes more interesting. However, I don't believe the team are targeting it at the moment. /cc @rstoyanchev @sdeleuze.
Indeed overall Grizzly would be a more straight forward fit on the Spring Reactive side. We would a Reactive Streams bridge for reading the HTTP requests and responses with back-pressure.
As stated earlier, it's just a matter of adding the appropriate Jars to make it work with Spring Web MVC.
Can you list which jars? Is there Servlet adapter code for Grizzly?
Hello @rstoyanchev
There are a couple of servlet dependencies at
https://grizzly.java.net/dependencies.html
You may have to try them and see the one that works for you.
The "Grizzly HTTP ‘All’ Bundle" seems to have all built in.
The one we are currently using is the Jersey container and it is built on top of Grizzly.
That one also have some servlet adapters: http://mvnrepository.com/artifact/org.glassfish.jersey.containers
@wilkinsona Any chance for a spring-boot-starter-grizzly
module?
Could fork the project and contribute what I currently have?
I see there is an grizzly-http-servlet
module for which it says:
NOTE: This is not a Servlet compliant implementation and as such, not all features exposed by a typical Servlet container are available here. The most recent versions of this library does provide features from the Servlet 3.1 specification.
If that's the only limitation (i.e the absence of Servlet 3.1 non-blocking I/O) that's not an issue in itself but I wonder if there are others not mentioned, e.g. Servlet 3.0 async is one that comes to mind?
@arcadius why not create a custom starter in your own repo for now and link it from here?
I second that and we can help you in the process. Please read this section first (naming in particular).
+1 support for embedded Grizzly
I think for now we won't have the time to develop Grizzly support ourselves. If a community effort happens we'd be happy to include a link.
I've implemented a spring boot starter module for grizzly which automatically registers Spring bean REST services and also support JSP pages. You can find the project here on github.
@dabla Nice. Do you mind if we add it to this list?
@dabla Nice. Do you mind if we add it to this list?
Of course not :)
Most helpful comment
+1 support for embedded Grizzly