Forum: JRuby Multiple JRuby-Rack apps in one WAR

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
steve_molitor (Guest)
on 2009-04-11 00:27
(Received via mailing list)
I want to package multiple apps (two sinatra apps and two rails apps) in
one
WAR, with rack URL mappings to determine which URL maps to which app.
How
who I go about doing that with Jruby-rack, warble?

Thanks!

Steve
--
View this message in context:
http://www.nabble.com/Multiple-JRuby-Rack-apps-in-...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Nick S. (Guest)
on 2009-04-11 01:36
(Received via mailing list)
On Fri, Apr 10, 2009 at 3:26 PM, steve_molitor 
<removed_email_address@domain.invalid>
wrote:
>
> I want to package multiple apps (two sinatra apps and two rails apps) in one
> WAR, with rack URL mappings to determine which URL maps to which app.  How
> who I go about doing that with Jruby-rack, warble?

Should be do-able, though you'll probably have to wire things up
yourself with a custom config.ru and using something like
Rack::Cascade. If you can make a rackup file that works outside of
jruby-rack, it should (with few to hopefully zero modifications) work
with it too.

/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
steve_molitor (Guest)
on 2009-04-11 04:38
(Received via mailing list)
Thanks, I got two sinatra apps WARed up in one war, running fine so far.
In
the ru file, for the sinatra apps, I just instantiate the app, which
extends
Sinatra::Base, and say 'run app'.  What's the best way to start a Rails
app
in this situation?

Also, can I set things up such that each app gets its own JRuby runtime?
Requests for each app would be multithreaded within that runtime.  I
worried
about two apps defining a class with the same name.

Thanks again!

Steve




Nick S.-2 wrote:
> Should be do-able, though you'll probably have to wire things up
>     http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Multiple-JRuby-Rack-apps-in-...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Nick S. (Guest)
on 2009-04-11 05:41
(Received via mailing list)
On Fri, Apr 10, 2009 at 7:37 PM, steve_molitor 
<removed_email_address@domain.invalid>
wrote:
>
> Thanks, I got two sinatra apps WARed up in one war, running fine so far.  In
> the ru file, for the sinatra apps, I just instantiate the app, which extends
> Sinatra::Base, and say 'run app'.  What's the best way to start a Rails app
> in this situation?
>
> Also, can I set things up such that each app gets its own JRuby runtime?
> Requests for each app would be multithreaded within that runtime.  I worried
> about two apps defining a class with the same name.

1. That should be possible, but not without you rolling up your
sleeves a bit. Right now the web app servlet context attributes
expects only a single RackApplicationFactory per app; you'll have to
make it multi-app-factory-aware.

2. You'll probably also need to map several copies of the RackFilter,
and make each filter use its own rack factory (see 1).

Hope that gives you enough of a hint to get started!

/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.