Best way to embed jetty with rack

Hi list,

Does anyone else embed jetty in their application? We do, but it is a
bit cobbled together, using a mix of an old version of jruby-rack and a
custom rack handler.

I like jruby-rack, because it looks pretty active, but it seems to only
support running your application inside an application server, whereas
we need to embed an application server.

I got it working like this, but I had to:

  • write a custom handler (that does the business of creating a jetty
    instance with the right options)
  • create a servlet filter that creates the environment, wraps the
    j2ee objects with the appropriate jruby rack objects and then calls
    the application

I did this about a year ago and it feels like things have moved on.

Could I be doing this with out my custom code? It still feels like I
need to - I can’t figure out if any of the libraries out there will
support my use case without making me compromise in some way.

Cheers,
Nick

On Sun, May 1, 2011 at 8:00 AM, Nick G. [email protected]
wrote:

I got it working like this, but I had to:
support my use case without making me compromise in some way.

Cheers,
Nick

I’ve had good success with mizuno as a rack server for sinatra.

-Jordan

I have heard this sentiment a bit recently, and understand why it makes
sense. JRuby-Rack really was built for use by servlet containers, not
for applications driven by Ruby code. And when Mizuno and Kirk show how
easy it is to script Jetty completely in Ruby, pieces start to come
together.

Still, the bottom line is that if your code still works and doesn’t
interfere with upgrades of JRuby or other components then you should be
ok staying where you are.

/Nick

On Mon, 2011-05-02 at 10:50 -0500, Nick S. wrote:

I have heard this sentiment a bit recently, and understand why it makes sense.
JRuby-Rack really was built for use by servlet containers, not for applications
driven by Ruby code. And when Mizuno and Kirk show how easy it is to script Jetty
completely in Ruby, pieces start to come together.

Nick - Are you interested in getting an embedded mode in to jruby-rack,
or do you think it is better served by the existing libraries? By the
looks of it, it could be done with some mild changes to some of the
interfaces and a couple of classes, but it might be a use-case too far.

My thought was that there is some important effort that gets repeated
and spread over all these different libraries, mostly with maintaining a
decent adapter between javax.servlet and rack/cgi. If that part could
be isolated somehow in a fairly reusable way… I’m sort of putting up
my hand for this if anyone else feels its worthwhile.


Nick G.
Developer @ Media Service Provider
+44 207 729 4797

On Tue, 2011-05-03 at 08:57 -0500, Nick S. wrote:

My thought was that there is some important effort that gets repeated
and spread over all these different libraries, mostly with maintaining a
decent adapter between javax.servlet and rack/cgi. If that part could
be isolated somehow in a fairly reusable way… I’m sort of putting up
my hand for this if anyone else feels its worthwhile.

I would like to see this happen, or at least explore it to see if it feels
right. Trinidad currently feels a bit of pain from this as well. Care to do a
small, incomplete spike to show what you’re thinking?

I’ll have a stab. Let’s see if my real life has enough time for me to
get it done.

/Nick

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Nick G.
Developer @ Media Service Provider
+44 207 729 4797

On May 3, 2011, at 08:22 , Nick G. wrote:

decent adapter between javax.servlet and rack/cgi. If that part could
be isolated somehow in a fairly reusable way… I’m sort of putting up
my hand for this if anyone else feels its worthwhile.

I would like to see this happen, or at least explore it to see if it
feels right. Trinidad currently feels a bit of pain from this as well.
Care to do a small, incomplete spike to show what you’re thinking?

/Nick

On Tue, 2011-05-03 at 18:49 +0100, Nick G. wrote:

On Tue, 2011-05-03 at 08:57 -0500, Nick S. wrote:

I would like to see this happen, or at least explore it to see if it feels
right. Trinidad currently feels a bit of pain from this as well. Care to do a
small, incomplete spike to show what you’re thinking?

I’ll have a stab. Let’s see if my real life has enough time for me to
get it done.

Almost done - just creating a little jruby-rack-jetty project that shows
an example, then I’ll push the lot to gitweb.

/Nick

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Nick G.
Developer @ Media Service Provider
+44 207 729 4797