SlideShare uma empresa Scribd logo
1 de 94
Baixar para ler offline
Bob McWhirter
                                 Presented at DevNexus
                                             22 March 2011
Creative  Commons  BY-­SA  3.0
Bob McWhirter

• Project  lead  of  TorqueBox
• JBoss  Fellow
• Founder  of  The  Codehaus
• Founder  of  Drools
• Been  with  Red  Hat  ~4  years
but it's a team.
What is TorqueBox?

The  mating  of  JRuby  to  
JBoss AS.
Goals
• Support  Ruby  web  frameworks
 • Rails
 • Sinatra
 • Rack
• Go  beyond  the  web
 • Messaging
 • Jobs
 • Services
But...

...Java  already  supports  
messaging,  jobs  and  
services.
That's right.
Why Ruby?

• No  compilation
• Low  ceremony
• Highly  expressive
• Lots  of  shiny  frameworks
• Few  specifications  (more  fun!)
• Meta
Expressive
                        anything.rb




teams.
    collect(&:members).
    flatten.uniq.each  &:promote!
Uhh...
                         com/foo/Anything.java

Set<Person>  people  =  new  HashSet<Person>();;

for  (  Team  each  :  teams  )  {
    people.addAll(  each.getMembers()  );;
}

for  (  Person  each  :  people  )  {
    each.promote();;
}
Why JRuby

• Very  fast  runtime
• Real  threads
• Java  libraries
• Java  tools
• Healthy  community
Easy Install. Even on Windows


$  wget  http://torquebox.org/torquebox-­dev.zip
$  unzip  torquebox-­dev.zip

$  export  TORQUEBOX_HOME=$PWD/torquebox-­1*
$  export  JBOSS_HOME=$TORQUEBOX_HOME/jboss
$  export  JRUBY_HOME=$TORQUEBOX_HOME/jruby

$  export  PATH=$JRUBY_HOME/bin:$PATH
Easy Install. Even on Windows


$ wget http://torquebox.org/torquebox-dev.zip
$ unzip torquebox-dev.zip

$  export  TORQUEBOX_HOME=$PWD/torquebox-­1*
$  export  JBOSS_HOME=$TORQUEBOX_HOME/jboss
$  export  JRUBY_HOME=$TORQUEBOX_HOME/jruby

$  export  PATH=$JRUBY_HOME/bin:$PATH
Easy Install. Even on Windows


$  wget  http://torquebox.org/torquebox-­dev.zip
$  unzip  torquebox-­dev.zip

$ export TORQUEBOX_HOME=$PWD/torquebox-1*
$ export JBOSS_HOME=$TORQUEBOX_HOME/jboss
$ export JRUBY_HOME=$TORQUEBOX_HOME/jruby

$  export  PATH=$JRUBY_HOME/bin:$PATH
Easy Install. Even on Windows


$  wget  http://torquebox.org/torquebox-­dev.zip
$  unzip  torquebox-­dev.zip Make  sure  the  jruby  
                            found  in  your  path  is  in  
                             $JRUBY_HOME/bin.
$  export  TORQUEBOX_HOME=$PWD/torquebox-­1*
$  export  JBOSS_HOME=$TORQUEBOX_HOME/jboss
$  export  JRUBY_HOME=$TORQUEBOX_HOME/jruby

$ export PATH=$JRUBY_HOME/bin:$PATH
The Details

Builds  upon  and  requires  
JBoss  AS  6.x.    

Tight  integration  with  the  
JBoss  stack.
The Competition

Warbler,  Trinidad,  Unicorn,  
Thin,  Passenger...

...all  address  only  the  web  
question.
Web

Run  Ruby  web-­apps  within  
the  context  of  the  Servlet  
container.    

Without compilation.
A rails application
RAILS_ROOT/                         Filename
    app/
        models/
            person.rb
        views/
            person/
                index.html.haml
                show.html.haml
        controllers/
            persons_controller.rb
    lib/
        my-­java-­components.jar
    config/
        database.yml
        torquebox.yml
Deploy!
                     Filename




$  rake  torquebox:deploy
But continue editing
Deployment  does  not  create  
archives  (by  default).

Continue  live-­editing  of  running  
app:  

models,views,  controllers...
Non-surprising.
Almost boring.
Web (Java Integration)
                                  Filename


class  SomeController

    def  index
        session[:password]  =  'sw0rdfish'
    end

end
Web (Java Integration)
                                                      Filename


public  class  SomeServlet  
{
    public  void  doGet(HttpServletRequest  req,
                                        HttpServletResponse  resp)  
    {
        request.getSession().getValue("password");;
    }
}
Clustering

Ruby  applications  participate  
fully  in  AS  clustering.

Can  use  JBoss  mod_cluster.
mod_cluster
A  reverse  proxy  implemented  as  
an  Apache  module  with  JBoss  
awareness.  

Constantly  gathers  load  statistics  
and  deployment  availability  for  
intelligent  request  distribution.
mod_cluster
mod_cluster

• Dynamic  configuration
• Server-­side  load  factor  calculation
• Fine-­grained  web  app  lifecycle
• AJP  (Apache  JServ  Protocol)  is  
  optional.  HTTP[S]  is  also  supported.
Let's go
beyond the
  web...
Scheduled Jobs
Jobs
             app/jobs/newsletter_sender.rb

class  NewsletterSender
  
    def run()
        subscriptions  =  Subscription.find(:all)
        subscriptions.each  do  |e|
            send_newsletter(  e  )
        end
    end
  
end
Jobs
                        config/torquebox.yml
jobs:
    monthly_newsletter:
        description:  first  of  month
        job:  NewsletterSender
        cron:  ‘0  0  0  1  *  ?’

    sandbox:
        job:  Sandbox
        cron:  ‘*/5  *  *  *  *  ?’
Messaging, Part 1
   (async tasks)
Tasks
                      app/tasks/email_task.rb
class  EmailTask  <  TorqueBox::Messaging::Task

    def  welcome(payload)
        person  =  payload[:person]  
        person  ||=  Person.find_by_id(payload[:id])
        if  person
            #  send  the  email
            person.welcomed  =  true
            person.save!
        end
    end

end
Tasks


EmailTask.async(:welcome,  payload  )
Tasks

Call  them  from  your  
controllers,  models,  and  
observers,  or  even  other  
tasks.  Even  in  non-­Rails  
apps!
Messaging, Part 2
 (backgroundable)
Regular Class
                   Filename
class  Something

    def  foo()
    end

    def  bar()
    end

end
Blocking invocations
                              Filename



something  =  Something.new

something.foo

something.bar
Backgroundable
                                    Filename
class  Something

  include TorqueBox::Messaging::Backgroundable

    def  foo()
    end

    def  bar()
    end

end
Non-blocking invocations
                              Filename



something  =  Something.new

something.background.foo

something.background.bar
Choices
                                      Filename
class  Something

    include  TorqueBox::Messaging::Backgroundable
  always_background :foo

    def  foo()
    end

    def  bar()
    end

end
Just do it right.
                              Filename



something  =  Something.new

something.foo
Messaging, Part 3
    (low-level)
Destinations
config/torquebox.yml

queues:
    /queues/questions:
    /queues/answers:
        durable:  false
topics:
    /topics/new_accounts
    /topics/notifications
Processors
config/torquebox.yml

messaging:
  /topics/print: PrintHandler
  /queues/popular:
    - PopularHandler
    - AdultObserver:
        filter: "age >= 18"
        concurrency: 5
  /queues/students:
    PrintHandler:
      config:
        color: true
Processors
app/models/print_handler.rb

include  TorqueBox::Messaging

class  PrintHandler  < MessageProcessor
    def  initialize(opts)
        @color  =  opts['color']
    end
    def  on_message(body)
        puts  "Processing  #{body}  of  #{message}"
    end
end
Queues
example

include  TorqueBox
req  =  Messaging::Queue.new  '/queues/questions'
res  =  Messaging::Queue.new  '/queues/answers'
  
Thread.new  do
    req.publish  "What  time  is  it?"
    puts  res.receive(  :timeout  =>  1000  )
end
  
puts  req.receive
res.publish  Time.now
Queues
example

include TorqueBox
req = Messaging::Queue.new '/queues/questions'
res = Messaging::Queue.new '/queues/answers'
  
Thread.new  do
    req.publish  "What  time  is  it?"
    puts  res.receive(  :timeout  =>  1000  )
end
  
puts  req.receive
res.publish  Time.now
Queues
example

include  TorqueBox
req  =  Messaging::Queue.new  '/queues/questions'
res  =  Messaging::Queue.new  '/queues/answers'
  
Thread.new do
   req.publish "What time is it?"
   puts res.receive( :timeout => 1000 )
end
  
puts  req.receive
res.publish  Time.now
Queues
example

include  TorqueBox
req  =  Messaging::Queue.new  '/queues/questions'
res  =  Messaging::Queue.new  '/queues/answers'
  
Thread.new  do
    req.publish  "What  time  is  it?"
    puts  res.receive(  :timeout  =>  1000  )
end
  
puts req.receive
res.publish Time.now
Queues
“on the fly”



include  TorqueBox

queue  =  Messaging::Queue.new  '/queues/foo'
queue.create
    ...  
queue.destroy
Topics

• behavior  is  different,  but  interface  is  
  the  same.
• all  subscribers  of  a  topic  see  each  
  message,  but  only  one  subscriber  
    will  see  any  message  from  a  queue
•   use  TorqueBox::Messaging::Topic
Services
run along, lil’ daemon
Services

Long-­running,  non-­web  
“daemons”  that  share  the  
runtime  environment  and  
deployment  lifecycle  of  your  
app.
Services

• Represented  as  a  class  with  
  optional  initialize(Hash),  
    start()  and  stop()  methods,  
    which  should  each  return  quickly.
•   Typically  will  start  a  long-­running  
    loop  in  a  thread  and  respond  to  
    external  events.
Services
config/torquebox.yml

services:
    IrcBot:
        server:  freenode.net
        channel:  #torquebox
        publish:  /topics/irc

    MyMudServer:

    SomeOtherService:
Services
app/{models,etc}/my_service.rb

class  MyService
    def  initialize  opts={}
        name  =  opts[:publish]
        @queue  =  Messaging::Queue.new(name)
    end
    def  start  
        Thread.new  {  run  }  
    end
    def  stop  
        @done  =  true
    end
end
Services
app/{models,etc}/my_service.rb

class  MyService
    def initialize opts={}
        name = opts[:publish]
        @queue = Messaging::Queue.new(name)
    end
    def  start  
        Thread.new  {  run  }  
    end
    def  stop  
        @done  =  true
    end
end
Services
app/{models,etc}/my_service.rb

class  MyService
    def  initialize  opts={}
        name  =  opts[:publish]
        @queue  =  Messaging::Queue.new(name)
    end
    def start
        Thread.new { run }
    end
    def  stop  
        @done  =  true
    end
end
Services
app/{models,etc}/my_service.rb

class  MyService
    def  initialize  opts={}
        name  =  opts[:publish]
        @queue  =  Messaging::Queue.new(name)
    end
    def  start  
        Thread.new  {  run  }  
    end
    def stop
        @done = true
    end
end
Services
app/{models,etc}/my_service.rb


class  MyService
    def  run
        until  @done
            @queue.publish(Time.now)
            sleep(1)  
        end
    end
end
Services
app/{models,etc}/my_service.rb


class  MyService
    def  run
      until @done
         @queue.publish(Time.now)
         sleep(1)
      end
    end
end
Caching
Caching NoSQL

Integration  with  JBoss
Infinispan,  a  distributed/
replicated  object  store.
Transparent Infinispan

Easily  used  for  all  of  the  
implicit  caching  within  Rails.

Replace  in-­memory,  or  
memcached  caches.
Opaque Infinispan
                                         Filename



include ActiveSupport::Cache

myCache = TorqueBoxStore.new(:name => 'MyCache',
                             :mode => :replicated,
                             :sync => true)
I N J E C T I O N
    (we must go deeper)
Injection?

Letting  the  container  figure  
out  how  to  help  you  wire  up  
complex  component  models.
aka


Inversion of Control

Guice, PicoContainer, JBoss Microcontainer
Java CDI
package  com.mycorp;;           Filename

@ApplicationScoped
class  Something  {
    @Inject
    private  Else  elsewise;;
}

@ApplicationScoped
class  Else  {

}
CDI Injection


class  MyService
    def  initialize  opts={}
        @thing  =  cdi(com.mycorp.Something)
    end
end
CDI Injection


class  MyService
    def  initialize  opts={}
        @thing  =  cdi(com.mycorp.Something)
    end
end
But there's more than
just CDI you can inject.
There's also heroin,
queues, topics and
other things.

But not really heroin.
           (Drugs are bad, m'kay?)
Destination Injection


class  MyService
    def  initialize  opts={}
        @inbound    =  topic(  "/topics/questions"  )
        @outbound  =  queue(  "/queues/answers"  )
    end
end
Destination Injection


class  MyService
    def  initialize  opts={}
        @inbound    =  topic( "/topics/questions" )
        @outbound  =  queue( "/queues/answers" )
    end
end
JNDI Injection


class  MyService
    def  initialize  opts={}
        @factory  =  naming("java:comp/env/jdbc/myDS")
    end
end
JNDI Injection


class  MyService
    def  initialize  opts={}
        @factory  =  naming("java:comp/env/jdbc/myDS")
    end
end
JBossMC Injection


class  MyService
    def  initialize  opts={}
        @heroin  =  mc(  "SomeMCBean"  )
    end
end
JBossMC Injection


class  MyService
    def  initialize  opts={}
        @heroin  =  mc( "SomeMCBean" )
    end
end
Why MC Beans?
All  internal  plumbing  of  
JBoss AS  is  stitched  
together  using  MC.    

Grab  the  WebServer,  the  
CacheManager,  whatevs.
But that's not all!
BackStage

Dashboard  to  inspect  and  
control  Ruby  components.

And  a  RESTful  API.
StompBox


Easy  Heroku-­esque  
git-­based  deployments.
StompBox
But how does it
   perform?
BENchmarks
Real-world Rail application:
Redmine
Comparisons:
TorqueBox,  Trinidad,  Passenger,  
Unicorn,  Glassfish,  Thin
Runtimes:
JRuby,  MRI,  RubyEE
Roadmap
May - 1.0.0.Final
Then...
    AS7
    Authentication
    Transactions
    Drools/jBPM/etc
    Mobicents
Resources

•   http://torquebox.org/
•   http://github.com/torquebox
•   #torquebox  on  FreeNode
•   @torquebox
Thanks, and don't
 forget to pick up
  some stickers.

Mais conteúdo relacionado

Mais procurados

JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxmarekgoldmann
 
Torquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosTorquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosBruno Oliveira
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrindermarekgoldmann
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011Lance Ball
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011tobiascrawley
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011tobiascrawley
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes BackBurke Libbey
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprisebenbrowning
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
Spring into rails
Spring into railsSpring into rails
Spring into railsHiro Asari
 
Ruby 1.9 Fibers
Ruby 1.9 FibersRuby 1.9 Fibers
Ruby 1.9 FibersKevin Ball
 
Fiber in the 10th year
Fiber in the 10th yearFiber in the 10th year
Fiber in the 10th yearKoichi Sasada
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developergicappa
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011Marcelo Jabali
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)ngotogenome
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
 

Mais procurados (20)

JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBox
 
Torquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosTorquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundos
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinder
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprise
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
First Day With J Ruby
First Day With J RubyFirst Day With J Ruby
First Day With J Ruby
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
Ruby 1.9 Fibers
Ruby 1.9 FibersRuby 1.9 Fibers
Ruby 1.9 Fibers
 
Ruby 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
 
Pfm technical-inside
Pfm technical-insidePfm technical-inside
Pfm technical-inside
 
Fiber in the 10th year
Fiber in the 10th yearFiber in the 10th year
Fiber in the 10th year
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
 
JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015JRuby 9000 - Taipei Ruby User's Group 2015
JRuby 9000 - Taipei Ruby User's Group 2015
 

Semelhante a TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus 2011.

Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Racksickill
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developerscacois
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller ColumnsJonathan Fine
 
TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012Saleem Ansari
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.jsChris Cowan
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends旻琦 潘
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backendDavid Padbury
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The WhenFITC
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails DevsDiacode
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring ClojurescriptLuke Donnet
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 

Semelhante a TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus 2011. (20)

Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Rack
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Play framework
Play frameworkPlay framework
Play framework
 
TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.js
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
React native
React nativeReact native
React native
 

Último

Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 

TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus 2011.

  • 1. Bob McWhirter Presented at DevNexus 22 March 2011 Creative  Commons  BY-­SA  3.0
  • 2. Bob McWhirter • Project  lead  of  TorqueBox • JBoss  Fellow • Founder  of  The  Codehaus • Founder  of  Drools • Been  with  Red  Hat  ~4  years
  • 3. but it's a team.
  • 4. What is TorqueBox? The  mating  of  JRuby  to   JBoss AS.
  • 5.
  • 6. Goals • Support  Ruby  web  frameworks • Rails • Sinatra • Rack • Go  beyond  the  web • Messaging • Jobs • Services
  • 7. But... ...Java  already  supports   messaging,  jobs  and   services.
  • 9. Why Ruby? • No  compilation • Low  ceremony • Highly  expressive • Lots  of  shiny  frameworks • Few  specifications  (more  fun!) • Meta
  • 10. Expressive anything.rb teams.    collect(&:members).    flatten.uniq.each  &:promote!
  • 11. Uhh... com/foo/Anything.java Set<Person>  people  =  new  HashSet<Person>();; for  (  Team  each  :  teams  )  {    people.addAll(  each.getMembers()  );; } for  (  Person  each  :  people  )  {    each.promote();; }
  • 12. Why JRuby • Very  fast  runtime • Real  threads • Java  libraries • Java  tools • Healthy  community
  • 13. Easy Install. Even on Windows $  wget  http://torquebox.org/torquebox-­dev.zip $  unzip  torquebox-­dev.zip $  export  TORQUEBOX_HOME=$PWD/torquebox-­1* $  export  JBOSS_HOME=$TORQUEBOX_HOME/jboss $  export  JRUBY_HOME=$TORQUEBOX_HOME/jruby $  export  PATH=$JRUBY_HOME/bin:$PATH
  • 14. Easy Install. Even on Windows $ wget http://torquebox.org/torquebox-dev.zip $ unzip torquebox-dev.zip $  export  TORQUEBOX_HOME=$PWD/torquebox-­1* $  export  JBOSS_HOME=$TORQUEBOX_HOME/jboss $  export  JRUBY_HOME=$TORQUEBOX_HOME/jruby $  export  PATH=$JRUBY_HOME/bin:$PATH
  • 15. Easy Install. Even on Windows $  wget  http://torquebox.org/torquebox-­dev.zip $  unzip  torquebox-­dev.zip $ export TORQUEBOX_HOME=$PWD/torquebox-1* $ export JBOSS_HOME=$TORQUEBOX_HOME/jboss $ export JRUBY_HOME=$TORQUEBOX_HOME/jruby $  export  PATH=$JRUBY_HOME/bin:$PATH
  • 16. Easy Install. Even on Windows $  wget  http://torquebox.org/torquebox-­dev.zip $  unzip  torquebox-­dev.zip Make  sure  the  jruby   found  in  your  path  is  in   $JRUBY_HOME/bin. $  export  TORQUEBOX_HOME=$PWD/torquebox-­1* $  export  JBOSS_HOME=$TORQUEBOX_HOME/jboss $  export  JRUBY_HOME=$TORQUEBOX_HOME/jruby $ export PATH=$JRUBY_HOME/bin:$PATH
  • 17. The Details Builds  upon  and  requires   JBoss  AS  6.x.     Tight  integration  with  the   JBoss  stack.
  • 18. The Competition Warbler,  Trinidad,  Unicorn,   Thin,  Passenger... ...all  address  only  the  web   question.
  • 19. Web Run  Ruby  web-­apps  within   the  context  of  the  Servlet   container.     Without compilation.
  • 20. A rails application RAILS_ROOT/ Filename    app/        models/            person.rb        views/            person/                index.html.haml                show.html.haml        controllers/            persons_controller.rb    lib/        my-­java-­components.jar    config/        database.yml        torquebox.yml
  • 21. Deploy! Filename $  rake  torquebox:deploy
  • 22. But continue editing Deployment  does  not  create   archives  (by  default). Continue  live-­editing  of  running   app:   models,views,  controllers...
  • 24. Web (Java Integration) Filename class  SomeController    def  index        session[:password]  =  'sw0rdfish'    end end
  • 25. Web (Java Integration) Filename public  class  SomeServlet   {    public  void  doGet(HttpServletRequest  req,                                        HttpServletResponse  resp)      {        request.getSession().getValue("password");;    } }
  • 26. Clustering Ruby  applications  participate   fully  in  AS  clustering. Can  use  JBoss  mod_cluster.
  • 27. mod_cluster A  reverse  proxy  implemented  as   an  Apache  module  with  JBoss   awareness.   Constantly  gathers  load  statistics   and  deployment  availability  for   intelligent  request  distribution.
  • 29. mod_cluster • Dynamic  configuration • Server-­side  load  factor  calculation • Fine-­grained  web  app  lifecycle • AJP  (Apache  JServ  Protocol)  is   optional.  HTTP[S]  is  also  supported.
  • 32. Jobs app/jobs/newsletter_sender.rb class  NewsletterSender      def run()        subscriptions  =  Subscription.find(:all)        subscriptions.each  do  |e|            send_newsletter(  e  )        end    end   end
  • 33. Jobs config/torquebox.yml jobs:    monthly_newsletter:        description:  first  of  month        job:  NewsletterSender        cron:  ‘0  0  0  1  *  ?’    sandbox:        job:  Sandbox        cron:  ‘*/5  *  *  *  *  ?’
  • 34. Messaging, Part 1 (async tasks)
  • 35. Tasks app/tasks/email_task.rb class  EmailTask  <  TorqueBox::Messaging::Task    def  welcome(payload)        person  =  payload[:person]          person  ||=  Person.find_by_id(payload[:id])        if  person            #  send  the  email            person.welcomed  =  true            person.save!        end    end end
  • 37. Tasks Call  them  from  your   controllers,  models,  and   observers,  or  even  other   tasks.  Even  in  non-­Rails   apps!
  • 38. Messaging, Part 2 (backgroundable)
  • 39. Regular Class Filename class  Something    def  foo()    end    def  bar()    end end
  • 40. Blocking invocations Filename something  =  Something.new something.foo something.bar
  • 41. Backgroundable Filename class  Something include TorqueBox::Messaging::Backgroundable    def  foo()    end    def  bar()    end end
  • 42. Non-blocking invocations Filename something  =  Something.new something.background.foo something.background.bar
  • 43. Choices Filename class  Something    include  TorqueBox::Messaging::Backgroundable always_background :foo    def  foo()    end    def  bar()    end end
  • 44. Just do it right. Filename something  =  Something.new something.foo
  • 45. Messaging, Part 3 (low-level)
  • 46. Destinations config/torquebox.yml queues:    /queues/questions:    /queues/answers:        durable:  false topics:    /topics/new_accounts    /topics/notifications
  • 47. Processors config/torquebox.yml messaging: /topics/print: PrintHandler /queues/popular: - PopularHandler - AdultObserver: filter: "age >= 18" concurrency: 5 /queues/students: PrintHandler: config: color: true
  • 48. Processors app/models/print_handler.rb include  TorqueBox::Messaging class  PrintHandler  < MessageProcessor    def  initialize(opts)        @color  =  opts['color']    end    def  on_message(body)        puts  "Processing  #{body}  of  #{message}"    end end
  • 49. Queues example include  TorqueBox req  =  Messaging::Queue.new  '/queues/questions' res  =  Messaging::Queue.new  '/queues/answers'   Thread.new  do    req.publish  "What  time  is  it?"    puts  res.receive(  :timeout  =>  1000  ) end   puts  req.receive res.publish  Time.now
  • 50. Queues example include TorqueBox req = Messaging::Queue.new '/queues/questions' res = Messaging::Queue.new '/queues/answers'   Thread.new  do    req.publish  "What  time  is  it?"    puts  res.receive(  :timeout  =>  1000  ) end   puts  req.receive res.publish  Time.now
  • 51. Queues example include  TorqueBox req  =  Messaging::Queue.new  '/queues/questions' res  =  Messaging::Queue.new  '/queues/answers'   Thread.new do req.publish "What time is it?" puts res.receive( :timeout => 1000 ) end   puts  req.receive res.publish  Time.now
  • 52. Queues example include  TorqueBox req  =  Messaging::Queue.new  '/queues/questions' res  =  Messaging::Queue.new  '/queues/answers'   Thread.new  do    req.publish  "What  time  is  it?"    puts  res.receive(  :timeout  =>  1000  ) end   puts req.receive res.publish Time.now
  • 53. Queues “on the fly” include  TorqueBox queue  =  Messaging::Queue.new  '/queues/foo' queue.create    ...   queue.destroy
  • 54. Topics • behavior  is  different,  but  interface  is   the  same. • all  subscribers  of  a  topic  see  each   message,  but  only  one  subscriber   will  see  any  message  from  a  queue • use  TorqueBox::Messaging::Topic
  • 56. Services Long-­running,  non-­web   “daemons”  that  share  the   runtime  environment  and   deployment  lifecycle  of  your   app.
  • 57. Services • Represented  as  a  class  with   optional  initialize(Hash),   start()  and  stop()  methods,   which  should  each  return  quickly. • Typically  will  start  a  long-­running   loop  in  a  thread  and  respond  to   external  events.
  • 58. Services config/torquebox.yml services:    IrcBot:        server:  freenode.net        channel:  #torquebox        publish:  /topics/irc    MyMudServer:    SomeOtherService:
  • 59. Services app/{models,etc}/my_service.rb class  MyService    def  initialize  opts={}        name  =  opts[:publish]        @queue  =  Messaging::Queue.new(name)    end    def  start          Thread.new  {  run  }      end    def  stop          @done  =  true    end end
  • 60. Services app/{models,etc}/my_service.rb class  MyService def initialize opts={} name = opts[:publish] @queue = Messaging::Queue.new(name) end    def  start          Thread.new  {  run  }      end    def  stop          @done  =  true    end end
  • 61. Services app/{models,etc}/my_service.rb class  MyService    def  initialize  opts={}        name  =  opts[:publish]        @queue  =  Messaging::Queue.new(name)    end def start Thread.new { run } end    def  stop          @done  =  true    end end
  • 62. Services app/{models,etc}/my_service.rb class  MyService    def  initialize  opts={}        name  =  opts[:publish]        @queue  =  Messaging::Queue.new(name)    end    def  start          Thread.new  {  run  }      end def stop @done = true end end
  • 63. Services app/{models,etc}/my_service.rb class  MyService    def  run        until  @done            @queue.publish(Time.now)            sleep(1)          end    end end
  • 64. Services app/{models,etc}/my_service.rb class  MyService    def  run until @done @queue.publish(Time.now) sleep(1) end    end end
  • 66. Caching NoSQL Integration  with  JBoss Infinispan,  a  distributed/ replicated  object  store.
  • 67. Transparent Infinispan Easily  used  for  all  of  the   implicit  caching  within  Rails. Replace  in-­memory,  or   memcached  caches.
  • 68. Opaque Infinispan Filename include ActiveSupport::Cache myCache = TorqueBoxStore.new(:name => 'MyCache', :mode => :replicated, :sync => true)
  • 69. I N J E C T I O N (we must go deeper)
  • 70. Injection? Letting  the  container  figure   out  how  to  help  you  wire  up   complex  component  models.
  • 71. aka Inversion of Control Guice, PicoContainer, JBoss Microcontainer
  • 72. Java CDI package  com.mycorp;; Filename @ApplicationScoped class  Something  { @Inject    private  Else  elsewise;; } @ApplicationScoped class  Else  { }
  • 73. CDI Injection class  MyService    def  initialize  opts={}        @thing  =  cdi(com.mycorp.Something)    end end
  • 74. CDI Injection class  MyService    def  initialize  opts={}        @thing  =  cdi(com.mycorp.Something)    end end
  • 75. But there's more than just CDI you can inject. There's also heroin, queues, topics and other things. But not really heroin. (Drugs are bad, m'kay?)
  • 76. Destination Injection class  MyService    def  initialize  opts={}        @inbound    =  topic(  "/topics/questions"  )        @outbound  =  queue(  "/queues/answers"  )    end end
  • 77. Destination Injection class  MyService    def  initialize  opts={}        @inbound    =  topic( "/topics/questions" )        @outbound  =  queue( "/queues/answers" )    end end
  • 78. JNDI Injection class  MyService    def  initialize  opts={}        @factory  =  naming("java:comp/env/jdbc/myDS")    end end
  • 79. JNDI Injection class  MyService    def  initialize  opts={}        @factory  =  naming("java:comp/env/jdbc/myDS")    end end
  • 80. JBossMC Injection class  MyService    def  initialize  opts={}        @heroin  =  mc(  "SomeMCBean"  )    end end
  • 81. JBossMC Injection class  MyService    def  initialize  opts={}        @heroin  =  mc( "SomeMCBean" )    end end
  • 82. Why MC Beans? All  internal  plumbing  of   JBoss AS  is  stitched   together  using  MC.     Grab  the  WebServer,  the   CacheManager,  whatevs.
  • 84. BackStage Dashboard  to  inspect  and   control  Ruby  components. And  a  RESTful  API.
  • 85.
  • 88. But how does it perform?
  • 89. BENchmarks Real-world Rail application: Redmine Comparisons: TorqueBox,  Trinidad,  Passenger,   Unicorn,  Glassfish,  Thin Runtimes: JRuby,  MRI,  RubyEE
  • 90.
  • 91.
  • 92. Roadmap May - 1.0.0.Final Then...    AS7    Authentication    Transactions    Drools/jBPM/etc    Mobicents
  • 93. Resources • http://torquebox.org/ • http://github.com/torquebox • #torquebox  on  FreeNode • @torquebox
  • 94. Thanks, and don't forget to pick up some stickers.