A hard working threaded HTTP 1.1 Rack server for JRuby using Jetty 7.x or 9.x. Fishwife deploys and operates like other Ruby HTTP servers/rack handlers such as Mongrel or Puma. No Java legacy war files (e.g. warbler) required.
As compared to similar projects, most notably Mizuno from which it was originally forked, Fishwife offers the following unique features:
Depends on the rjack-jetty gem which closely tracks the upstream Jetty project, currently for versions 7.x and 9.x. You can test and control the version of Jetty you use, for example via Bundler, independent of the Fishwife release.
Fishwife may itself be embedded in your own custom server/launcher where you have total control over JVM options like heap size, number of threads, and other initialization/configuration details. For an example, see: boxed-geminabox and notes in #6.
Logging is unified across Jetty, Fishwife, and your application via rjack-slf4j and on to any supported output adapter. (See Logging below)
Rack output streaming is optimized in a custom java extension.
Simple foreground server. Compatible with several real process monitors (See Process Monitoring below)
To use Fishwife with your Rack app and config.ru:
gem install fishwife cd /path/to/my/rack/app
rackup -s Fishwife
Fishwife::HttpServer::new supported options
Notes below on Logging and Process Monitoring
Fishwife requires rjack-slf4j which provides a unified interface for Java/Ruby logging. Jetty auto-detect SLF4J's presence and logs there. A logging output provider must also be loaded. The fishwife script will load rjack-logback if found or otherwise fall back to `rjack-slf4j/simple`. If you are starting Fishwife through some other means than the fishwife script, you will need to load an output provider (see linked docs and notes in #6).
We assume this isn't your only production ruby server and don't include any one-off, half-baked process control and monitoring features. Note that Unix-like fork(2) is not safe on the JVM and thus from JRuby so its not practical to support a fishwife –daemon flag. Fishwife simply logs to STDERR by default. Instead consider using:
Bluepill or God (MRI Ruby) process monitors support self-forking of foreground processes, for example `rackup` or `fishwife`.
All options also support redirecting log output (including any JVM-level errors) to a file. Iyyov supports log rotation internally. Unix-like logrotate(8) may be used with the former process monitors.
Building from Source and Contributing
You'll need a working Java 8+ JDK (with javac) and recent JRuby 1.7.x or 9.x on your PATH. Then:
jruby -S gem install rjack-tarpit -v'~> 2.1' jruby -S gem install bundler jruby -S bundle install jruby -S bundle exec rake test
This above is intentionally pedantic to hopefully minimize any confusion.
Copyright © 2011-2017 David Kellum
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2010-2011 Don Werve
Licensed under the Apache Public License, version 2.0.