Skip to main content

Extending the Grizzly HTTP Runtime

Posted by jfarcand on July 3, 2008 at 8:52 PM PDT

This blog has moved here

Related Topics >>


it'd be good to update the

it'd be good to update the main grizzly site with up to date links, its tricky finding the actual getting started guides the docs talk about...

Hi Jean-Francois, I have a problem with manage threads using Grizzly -- I wrote a http server like follows: GrizzlyWebServer gws = new GrizzlyWebServer(PORT); //set thread number ws.setCoreThreads(100); // Add a GrizzlyAdapter gws.addGrizzlyAdapter(new GrizzlyAdapter() public void service(GrizzlyRequest req, GrizzlyResponse res){ // some computationally intensive code ... ); // Start Web server gws.start(); // Count total thread.... while (true) { Thread.sleep(5000); System.out.println("total threads: " + Thread.getAllStackTraces().size()); } After starting the server, I sent many requests to it and then the server printed out something like: total threads: 56 ... total threads: 145 Even after I close the client, the number of active threads still remain as high as 145 !! Where did I do wrong?! and how do I fix this? Any help is appreciated. Thank you in advance. Shawn

I found the embed package. It turns out it's in the 1.8.2-SNAPSHOT packages.

Salut. I've just re-uploaded the 1.8.1 jars to see if that will make a difference. Wait 10 minutes and you should be able to use it. Let us know on if that doesn't. Thanks for you interest! -- Jeanfrancois

Hi Jean-Francois, I wanted to play around with your examples, but I was having issues. It seems that GrizzlyWebServer is in com.sun.grizzly.http.embed but the grizzly-servlet-webserver-1.8.1.jar has no com.sun.grizzly.http.embed package. Did I misunderstand and download the wrong jar? Thanks, Collin