SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
When Ruby
                             Meets Java
                     T h e   Powe r   o f To r q u e b o x




Monday 26 March 12
About Us
               A r   u n A g r aw a l
                -    2 8 0 + c o m m i t s i n R a i l s c o re
                -    M o n g o i d c o re t e a m m e m b e r
                -    C re a t o r o f o m n i a u t h - t w i t t e r
                -    C o d i n g o n R a i l s s i n c e 2 0 0 7
                -    a g r aw a l a r u n . c o m / @ a r u n a g w


               R o   c k y J a i s w a l
                -    C o d i n g s i n c e 1 9 9 5
                -    K n o w b i t s o f J av a & R u b y
                -    E n j oy u s i n g J R u b y
                -    ro c k y j . i n / @ w h a t s u p ro c k y




Monday 26 March 12
ToDo
        - T h e E n t e r p r i s e
        - W h a t i s To r q u e b o x
        - D e m o
          - S c h e d u l i n g
          - S e r v i c e s
          - M e s s a g i n g
          - B a c k g ro u n d a b l e
          - C l u s t e r i n g & C a c h i n g
        - Pe r f o r m a n c e & S u m m a r y
        -      S u r p r i s e ! !




Monday 26 March 12
Pop Quiz

      Coolest Thing
    About JRuby(1.6) ?



Monday 26 March 12
The Enterprise




Monday 26 March 12
What If...
      Wouldn’t it be great if

            - I could use the power of Java libraries with the ease of
            Ruby

            - I could use the power of a proven Java Server without
            writing any XML

            - I could deploy my JRuby app and test it without rebuilding
            it and restarting the server




Monday 26 March 12
TORQUEBOX


                      Built upon JBoss 7
                      Built using JRuby (1.6.7)
                      Supports Rack, Rails, Sinatra
                      Everything in one box



Monday 26 March 12
TORQUEBOX




Monday 26 March 12
Installation
         - Download the distribution from torquebox.org

         OR

         - rvm jruby (1.6.7)
            jruby -J-Xmx1024m -S gem install torquebox-server --pre




Monday 26 March 12
Our Sh***y App




Monday 26 March 12
Scheduling
               Uses the battle-tested Quartz Java library

               Zero XML

               Minimal configuration

               No manual thread / process management

               No messing with cron




Monday 26 March 12
Scheduling
                     config/torquebox.yml

                     jobs:
                       mail_notifier:
                        job:      MailNotifier
                        cron:      '*/5 * * * * ?'
                        description: Deliver reminder email

                     class MailNotifier

                      def run
                       send_reminder_notification
                      end

                      def send_reminder_notification
                       puts "Sending mail ..."
                       #UserMailer.reminder_email(User.find(1)).deliver
                      end

                     end




Monday 26 March 12
Services
               Long running services with 3 line configuration

               Full access to the Rails environment

               JVM threads!




Monday 26 March 12
Services
               config/torquebox.yml
               services:
                MessageNotifier:
                  config:
                   name: hello

               class MessageNotifier
                 def initialize(opts={})
                  @name = opts['name']
                 end
                 def start
                  Thread.new { run }
                 end
                 def stop
                  @done = true
                 end
                 def run
                  until @done
                    do_something #todo
                    sleep(5)
                  end
                 end
               end
Monday 26 March 12
Messaging
          JMS supported out-of-the-box (HornetQ)


          Advanced Messaging Queuing Protocol (AMQP)
          - RabbitMQ


          Supports STOMP out of the box




Monday 26 March 12
AMQP




Monday 26 March 12
Messaging
                In a long running service -
                ...
                def do_something
                    puts "Checking the queue for messages ..."

                     bunny = Bunny.new(:logging => false)

                     # start a communication session with the amqp server
                     bunny.start

                     # declare a queue
                     q = bunny.queue(@name)

                     # get message from the queue
                     msg = q.pop[:payload]

                     puts "This is the message: " + msg.to_s

                  # close the connection
                  bunny.stop
                end


Monday 26 March 12
Backgroundable
                     As easy as A, B, C ...

                     class User < ActiveRecord::Base
                       include TorqueBox::Messaging::Backgroundable

                      always_background :send_signup_notification

                      validates_confirmation_of :
                      ...

                      def send_signup_notification(user)
                       UserMailer.welcome_email(user).deliver
                      end

                     end

Monday 26 March 12
Clustering
                 torquebox run --clustered

                 Does everything

                 Servers in a LAN are automatically clustered

                 Top it up with mod_cluster from JBoss




Monday 26 March 12
Caching
        TorqueBox provides an implementation of the Rails 3.x
        ActiveSupport::Cache::Store that exposes your
        application to the Infinispan data grid.

        Uses Infinispan by default

        Can utilize the cluster with minimal config

        Share the cache across the cluster - FTW!




Monday 26 March 12
Performance




Monday 26 March 12
Performance




Monday 26 March 12
Risks
           - Version 2 is quite stable but still at RC1

           - Upgrading JRuby will not help sometimes

           - You will be on a cutting edge open-source
           technology but documentation is great, help is
           available online and on IRC




Monday 26 March 12
Surprise!!!




Monday 26 March 12
Questions?



Monday 26 March 12
Thank You



Monday 26 March 12

Mais conteúdo relacionado

Mais procurados

DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on InfinispanLance Ball
 
JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxmarekgoldmann
 
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
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011tobiascrawley
 
Spring into rails
Spring into railsSpring into rails
Spring into railsHiro Asari
 
Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존동수 장
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Applicationguest1f2740
 
JRuby @ Boulder Ruby
JRuby @ Boulder RubyJRuby @ Boulder Ruby
JRuby @ Boulder RubyNick Sieger
 
TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012Saleem Ansari
 
Fiber in the 10th year
Fiber in the 10th yearFiber in the 10th year
Fiber in the 10th yearKoichi Sasada
 
Service-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMixService-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMixBruce Snyder
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
Cloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and VaadinCloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and VaadinJoshua Long
 

Mais procurados (20)

DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on Infinispan
 
JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBox
 
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
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011
 
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 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
 
Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Application
 
JRuby @ Boulder Ruby
JRuby @ Boulder RubyJRuby @ Boulder Ruby
JRuby @ Boulder Ruby
 
201904 websocket
201904 websocket201904 websocket
201904 websocket
 
TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012TorqueBox at GNUnify 2012
TorqueBox at GNUnify 2012
 
Fiber in the 10th year
Fiber in the 10th yearFiber in the 10th year
Fiber in the 10th year
 
Service-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMixService-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMix
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
Cloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and VaadinCloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and Vaadin
 

Destaque

Flow Engines - Hack The Way You Work, Not The Time You Have
Flow Engines - Hack The Way You Work, Not The Time You HaveFlow Engines - Hack The Way You Work, Not The Time You Have
Flow Engines - Hack The Way You Work, Not The Time You HaveJohn V Willshire
 
OPEN Silcon Valley - Clean-tech is Main-tech: How do you fit in the Green Ec...
OPEN Silcon Valley - Clean-tech is Main-tech:  How do you fit in the Green Ec...OPEN Silcon Valley - Clean-tech is Main-tech:  How do you fit in the Green Ec...
OPEN Silcon Valley - Clean-tech is Main-tech: How do you fit in the Green Ec...Shuja Keen
 
How we built our community using Github - Uri Cohen
How we built our community using Github - Uri CohenHow we built our community using Github - Uri Cohen
How we built our community using Github - Uri CohenOSCON Byrum
 
Visual Conversations on Urban Futures - DRS 2016
Visual Conversations on Urban Futures - DRS 2016Visual Conversations on Urban Futures - DRS 2016
Visual Conversations on Urban Futures - DRS 2016serena pollastri
 
Pattern: an open source project for migrating predictive models onto Apache H...
Pattern: an open source project for migrating predictive models onto Apache H...Pattern: an open source project for migrating predictive models onto Apache H...
Pattern: an open source project for migrating predictive models onto Apache H...Paco Nathan
 
AWS Start-Up Tour 2009 / ShareThis
AWS Start-Up Tour 2009 / ShareThisAWS Start-Up Tour 2009 / ShareThis
AWS Start-Up Tour 2009 / ShareThisPaco Nathan
 
Technical Debt and Selling Rearchitecture
Technical Debt and Selling RearchitectureTechnical Debt and Selling Rearchitecture
Technical Debt and Selling RearchitectureSergey Sundukovskiy
 
Traffic Signal Movie Preview
Traffic Signal Movie PreviewTraffic Signal Movie Preview
Traffic Signal Movie PreviewKapil Mohan
 
25 Words Of Social Media Wisdom Project
25 Words Of Social Media Wisdom Project25 Words Of Social Media Wisdom Project
25 Words Of Social Media Wisdom ProjectLiz Strauss
 
The Clothesline Paradox and the Sharing Economy (Keynote file)
The Clothesline Paradox and the Sharing Economy (Keynote file)The Clothesline Paradox and the Sharing Economy (Keynote file)
The Clothesline Paradox and the Sharing Economy (Keynote file)Tim O'Reilly
 
A New Business World Within A Blockchain
A New Business World Within A BlockchainA New Business World Within A Blockchain
A New Business World Within A BlockchainAlex Chepurnoy
 
Code curiosity rubyconfindia 2016 talk
Code curiosity rubyconfindia 2016 talkCode curiosity rubyconfindia 2016 talk
Code curiosity rubyconfindia 2016 talkSethupathi Asokan
 
Village Global 2009 : Séance 1
Village Global 2009 : Séance 1Village Global 2009 : Séance 1
Village Global 2009 : Séance 1Emilie Marquois
 
Intro to Water-based Coatings
Intro to Water-based CoatingsIntro to Water-based Coatings
Intro to Water-based CoatingsTotal Cray Valley
 
Introduction to Slideshare at Barcamp Hyderabad
Introduction to Slideshare at Barcamp HyderabadIntroduction to Slideshare at Barcamp Hyderabad
Introduction to Slideshare at Barcamp HyderabadKapil Mohan
 
Silverchair Strategies
Silverchair StrategiesSilverchair Strategies
Silverchair StrategiesTim O'Reilly
 
Cascading meetup #4 @ BlueKai
Cascading meetup #4 @ BlueKaiCascading meetup #4 @ BlueKai
Cascading meetup #4 @ BlueKaiPaco Nathan
 
Open Data: From the Information Age to the Action Age (Keynote File)
Open Data: From the Information Age to the Action Age (Keynote File)Open Data: From the Information Age to the Action Age (Keynote File)
Open Data: From the Information Age to the Action Age (Keynote File)Tim O'Reilly
 

Destaque (20)

Flow Engines - Hack The Way You Work, Not The Time You Have
Flow Engines - Hack The Way You Work, Not The Time You HaveFlow Engines - Hack The Way You Work, Not The Time You Have
Flow Engines - Hack The Way You Work, Not The Time You Have
 
Copy Cultures
Copy CulturesCopy Cultures
Copy Cultures
 
Why go google
Why go googleWhy go google
Why go google
 
OPEN Silcon Valley - Clean-tech is Main-tech: How do you fit in the Green Ec...
OPEN Silcon Valley - Clean-tech is Main-tech:  How do you fit in the Green Ec...OPEN Silcon Valley - Clean-tech is Main-tech:  How do you fit in the Green Ec...
OPEN Silcon Valley - Clean-tech is Main-tech: How do you fit in the Green Ec...
 
How we built our community using Github - Uri Cohen
How we built our community using Github - Uri CohenHow we built our community using Github - Uri Cohen
How we built our community using Github - Uri Cohen
 
Visual Conversations on Urban Futures - DRS 2016
Visual Conversations on Urban Futures - DRS 2016Visual Conversations on Urban Futures - DRS 2016
Visual Conversations on Urban Futures - DRS 2016
 
Pattern: an open source project for migrating predictive models onto Apache H...
Pattern: an open source project for migrating predictive models onto Apache H...Pattern: an open source project for migrating predictive models onto Apache H...
Pattern: an open source project for migrating predictive models onto Apache H...
 
AWS Start-Up Tour 2009 / ShareThis
AWS Start-Up Tour 2009 / ShareThisAWS Start-Up Tour 2009 / ShareThis
AWS Start-Up Tour 2009 / ShareThis
 
Technical Debt and Selling Rearchitecture
Technical Debt and Selling RearchitectureTechnical Debt and Selling Rearchitecture
Technical Debt and Selling Rearchitecture
 
Traffic Signal Movie Preview
Traffic Signal Movie PreviewTraffic Signal Movie Preview
Traffic Signal Movie Preview
 
25 Words Of Social Media Wisdom Project
25 Words Of Social Media Wisdom Project25 Words Of Social Media Wisdom Project
25 Words Of Social Media Wisdom Project
 
The Clothesline Paradox and the Sharing Economy (Keynote file)
The Clothesline Paradox and the Sharing Economy (Keynote file)The Clothesline Paradox and the Sharing Economy (Keynote file)
The Clothesline Paradox and the Sharing Economy (Keynote file)
 
A New Business World Within A Blockchain
A New Business World Within A BlockchainA New Business World Within A Blockchain
A New Business World Within A Blockchain
 
Code curiosity rubyconfindia 2016 talk
Code curiosity rubyconfindia 2016 talkCode curiosity rubyconfindia 2016 talk
Code curiosity rubyconfindia 2016 talk
 
Village Global 2009 : Séance 1
Village Global 2009 : Séance 1Village Global 2009 : Séance 1
Village Global 2009 : Séance 1
 
Intro to Water-based Coatings
Intro to Water-based CoatingsIntro to Water-based Coatings
Intro to Water-based Coatings
 
Introduction to Slideshare at Barcamp Hyderabad
Introduction to Slideshare at Barcamp HyderabadIntroduction to Slideshare at Barcamp Hyderabad
Introduction to Slideshare at Barcamp Hyderabad
 
Silverchair Strategies
Silverchair StrategiesSilverchair Strategies
Silverchair Strategies
 
Cascading meetup #4 @ BlueKai
Cascading meetup #4 @ BlueKaiCascading meetup #4 @ BlueKai
Cascading meetup #4 @ BlueKai
 
Open Data: From the Information Age to the Action Age (Keynote File)
Open Data: From the Information Age to the Action Age (Keynote File)Open Data: From the Information Age to the Action Age (Keynote File)
Open Data: From the Information Age to the Action Age (Keynote File)
 

Semelhante a When Ruby Meets Java - The Power of Torquebox

Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot SystemAlvaro Videla
 
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?bodepd
 
Standing on the shoulders of giants with JRuby
Standing on the shoulders of giants with JRubyStanding on the shoulders of giants with JRuby
Standing on the shoulders of giants with JRubyTheo Hultberg
 
Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deploymentzeeg
 
Solr Troubleshooting - TreeMap approach
Solr Troubleshooting - TreeMap approachSolr Troubleshooting - TreeMap approach
Solr Troubleshooting - TreeMap approachAlexandre Rafalovitch
 
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...Lucidworks
 
Range reader/writer locking for the Linux kernel
Range reader/writer locking for the Linux kernelRange reader/writer locking for the Linux kernel
Range reader/writer locking for the Linux kernelDavidlohr Bueso
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Vincent Batts
 
The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013Charles Nutter
 
Katello on TorqueBox
Katello on TorqueBoxKatello on TorqueBox
Katello on TorqueBoxlzap
 
Building a compiler in JRuby
Building a compiler in JRubyBuilding a compiler in JRuby
Building a compiler in JRubyakinsgre
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Matt Aimonetti
 
12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASMMonowar Mukul
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruUse Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruTim Callaghan
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Sparksamthemonad
 

Semelhante a When Ruby Meets Java - The Power of Torquebox (20)

Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot System
 
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?
 
Standing on the shoulders of giants with JRuby
Standing on the shoulders of giants with JRubyStanding on the shoulders of giants with JRuby
Standing on the shoulders of giants with JRuby
 
Practicing Continuous Deployment
Practicing Continuous DeploymentPracticing Continuous Deployment
Practicing Continuous Deployment
 
Solr Troubleshooting - TreeMap approach
Solr Troubleshooting - TreeMap approachSolr Troubleshooting - TreeMap approach
Solr Troubleshooting - TreeMap approach
 
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
Solr Troubleshooting - Treemap Approach: Presented by Alexandre Rafolovitch, ...
 
Lec7
Lec7Lec7
Lec7
 
Range reader/writer locking for the Linux kernel
Range reader/writer locking for the Linux kernelRange reader/writer locking for the Linux kernel
Range reader/writer locking for the Linux kernel
 
StORM preview
StORM previewStORM preview
StORM preview
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013
 
Rapid Home Provisioning
Rapid Home ProvisioningRapid Home Provisioning
Rapid Home Provisioning
 
Katello on TorqueBox
Katello on TorqueBoxKatello on TorqueBox
Katello on TorqueBox
 
Building a compiler in JRuby
Building a compiler in JRubyBuilding a compiler in JRuby
Building a compiler in JRuby
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruUse Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB Guru
 
Sge
SgeSge
Sge
 
Spark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with SparkSpark 4th Meetup Londond - Building a Product with Spark
Spark 4th Meetup Londond - Building a Product with Spark
 
Go Replicator
Go ReplicatorGo Replicator
Go Replicator
 

Último

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Último (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

When Ruby Meets Java - The Power of Torquebox

  • 1. When Ruby Meets Java T h e Powe r o f To r q u e b o x Monday 26 March 12
  • 2. About Us A r u n A g r aw a l - 2 8 0 + c o m m i t s i n R a i l s c o re - M o n g o i d c o re t e a m m e m b e r - C re a t o r o f o m n i a u t h - t w i t t e r - C o d i n g o n R a i l s s i n c e 2 0 0 7 - a g r aw a l a r u n . c o m / @ a r u n a g w R o c k y J a i s w a l - C o d i n g s i n c e 1 9 9 5 - K n o w b i t s o f J av a & R u b y - E n j oy u s i n g J R u b y - ro c k y j . i n / @ w h a t s u p ro c k y Monday 26 March 12
  • 3. ToDo - T h e E n t e r p r i s e - W h a t i s To r q u e b o x - D e m o - S c h e d u l i n g - S e r v i c e s - M e s s a g i n g - B a c k g ro u n d a b l e - C l u s t e r i n g & C a c h i n g - Pe r f o r m a n c e & S u m m a r y - S u r p r i s e ! ! Monday 26 March 12
  • 4. Pop Quiz Coolest Thing About JRuby(1.6) ? Monday 26 March 12
  • 6. What If... Wouldn’t it be great if - I could use the power of Java libraries with the ease of Ruby - I could use the power of a proven Java Server without writing any XML - I could deploy my JRuby app and test it without rebuilding it and restarting the server Monday 26 March 12
  • 7. TORQUEBOX Built upon JBoss 7 Built using JRuby (1.6.7) Supports Rack, Rails, Sinatra Everything in one box Monday 26 March 12
  • 9. Installation - Download the distribution from torquebox.org OR - rvm jruby (1.6.7) jruby -J-Xmx1024m -S gem install torquebox-server --pre Monday 26 March 12
  • 10. Our Sh***y App Monday 26 March 12
  • 11. Scheduling Uses the battle-tested Quartz Java library Zero XML Minimal configuration No manual thread / process management No messing with cron Monday 26 March 12
  • 12. Scheduling config/torquebox.yml jobs: mail_notifier: job: MailNotifier cron: '*/5 * * * * ?' description: Deliver reminder email class MailNotifier def run send_reminder_notification end def send_reminder_notification puts "Sending mail ..." #UserMailer.reminder_email(User.find(1)).deliver end end Monday 26 March 12
  • 13. Services Long running services with 3 line configuration Full access to the Rails environment JVM threads! Monday 26 March 12
  • 14. Services config/torquebox.yml services: MessageNotifier: config: name: hello class MessageNotifier def initialize(opts={}) @name = opts['name'] end def start Thread.new { run } end def stop @done = true end def run until @done do_something #todo sleep(5) end end end Monday 26 March 12
  • 15. Messaging JMS supported out-of-the-box (HornetQ) Advanced Messaging Queuing Protocol (AMQP) - RabbitMQ Supports STOMP out of the box Monday 26 March 12
  • 17. Messaging In a long running service - ... def do_something puts "Checking the queue for messages ..." bunny = Bunny.new(:logging => false) # start a communication session with the amqp server bunny.start # declare a queue q = bunny.queue(@name) # get message from the queue msg = q.pop[:payload] puts "This is the message: " + msg.to_s # close the connection bunny.stop end Monday 26 March 12
  • 18. Backgroundable As easy as A, B, C ... class User < ActiveRecord::Base include TorqueBox::Messaging::Backgroundable always_background :send_signup_notification validates_confirmation_of : ... def send_signup_notification(user) UserMailer.welcome_email(user).deliver end end Monday 26 March 12
  • 19. Clustering torquebox run --clustered Does everything Servers in a LAN are automatically clustered Top it up with mod_cluster from JBoss Monday 26 March 12
  • 20. Caching TorqueBox provides an implementation of the Rails 3.x ActiveSupport::Cache::Store that exposes your application to the Infinispan data grid. Uses Infinispan by default Can utilize the cluster with minimal config Share the cache across the cluster - FTW! Monday 26 March 12
  • 23. Risks - Version 2 is quite stable but still at RC1 - Upgrading JRuby will not help sometimes - You will be on a cutting edge open-source technology but documentation is great, help is available online and on IRC Monday 26 March 12