The Source for Java Technology Collaboration
User: Password:



Jean-Francois Arcand

Jean-Francois Arcand's Blog

Jezzly or Gretty? Running Jetty on top of Grizzly

Posted by jfarcand on November 09, 2006 at 07:28 PM | Comments (4)

Since a couple of weeks I've been working with the Jetty team to investigate how we can front Jetty with Grizzly. Well, I'm happy to announce the collaboration worked very well and you can now get a preview of Jetty powered by Grizzly.

taurreau.jpgt

Recently I got an email from Greg Wilkins about exploring a way to use Grizzly in Jetty. The challenge was high because we had to learn each other code to see where we can bridge the two products. Jetty 6 already have an NIO based connector that works pretty well, but still we were interested to see if my NIO tricks can make a difference(see part 1,2,3,4,5). With a couple of emails exchange, we were able to define how to integrate. Our goal was to get the Grizzly framework from the Maven repository, and build the Jetty extension on top of it. Interestingly, the number of classes required are quite small(see the code here). If you are looking to extend Grizzly for your own needs, I recommend you take a look at the current code (and also see the excellent blog from Brian McCallister).

Eager to know how to run it? This is quite easy (Jetty is sooooo easy to configure!)

The easiest way to try it is to build Jetty from source. This is very easy to build it. Next, just do:


   % cd jetty
   % java -jar start.jar etc/jetty-grizzly.xml

You should see:


2006-11-09 21:24:36.331::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
2006-11-09 21:24:36.625::INFO:  jetty-6.1-SNAPSHOT
2006-11-09 21:24:36.871::INFO:  Started GrizzlyConnector @ 0.0.0.0:8888
INFO: 
 Grizzly configuration for port 8888
         maxThreads: 15
         minThreads: 2
         ByteBuffer size: 8192
         useDirectByteBuffer: false
         useByteBufferView: false
         maxHttpHeaderSize: 8192
         maxKeepAliveRequests: 256
         keepAliveTimeoutInSeconds: 30
         Static File Cache enabled: true
         Stream Algorithm :JettyStreamAlgorithm
         Pipeline : LinkedListPipeline
         Round Robin Selector Algorithm enabled: false
         Round Robin Selector pool size: 0
         recycleTasks: true
         Asynchronous Request Processing enabled: false

That's it. Very easy.

Now this is just the beginning. We still have to explore how we can use Grizzly ARP to support Jetty Continuation,add non blocking SSL support, etc. It might not work at all, but the current results looks promising.

One thing I would really like to do once Grizzly is fully integrated is to support Jetty in GlassFish, like other Application Server.

But wait, since Jetty can be embedded in JBoss, Jonas and Geronimo, it means Grizzly extensions will be available to all those products :-). That also means I can possibly run some benchmarks where Grizzly compete against Grizzly. I can envision the name of the blog: Can a Grizzly run faster than .......a Grizzly?!!!!

technorati:


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • hi there,

    should it not be "grizzly on jetty ?"

    how about grizzly on top of tomcat ? that will make it more useful to the lots of people using tomcat ?

    BR,
    ~A

    Posted by: anjanb2 on November 10, 2006 at 03:39 PM

  • Hi, I think I can make it work on Tomcat as well :-) Let me come back to you in a couple of weeks :-)

    Posted by: jfarcand on November 14, 2006 at 05:17 PM

  • Good work! Great to see you're collaborating instead of competing as I would expect.

    Posted by: mparaz on November 22, 2006 at 04:11 AM

  • 好狗网 狗的新闻咨询 狗的种类 狗狗的饲养 狗狗的生育繁殖 狗的美容护理 宠物狗的训练 宠物狗的用品服装 狗的医疗 买狗技巧 狗狗比赛 狗狗新闻 养狗的法律法规 狗狗赛场 狗狗展会 宠物故事 养狗须知 如何选狗 狗狗护理 怎样喂养宠物狗 狗的常见疾病 宠物狗的美容常识 宠物狗的体毛美容 宠物狗的五官美容 宠物狗的足部美容 宠物狗的基础训练 狗的矫正训练 狗的动作训练 狗的食品 宠物狗的服装 狗狗的生活用品 狗的玩具 玩赏犬 牧羊犬 工作犬 狩猎犬 运动犬 非运动犬 梗犬类 狗狗的发情 狗狗的配种 狗狗的孕期 狗狗的临产 狗狗的产后护理 狗狗的避孕

    Posted by: zhongliu on December 01, 2006 at 11:15 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds