SlideShare a Scribd company logo
O melhor dos dois mundos

  Creative  Commons  BY-­SA  3.0




Saturday, July 23, 2011
@abstractj

            Java há 12 anos, Ruby n00b
            TorqueBox Contributor
            Instrutor Caelum


Saturday, July 23, 2011
DISCLAIMER



Saturday, July 23, 2011
Java



      Come to the dark side

Saturday, July 23, 2011
ENTERPRISE



Saturday, July 23, 2011
JAXR                        Java-FX     JAXP
                          JSTL                         StAX JME
                                 JDOM       JVM
          JAX-RPC                                    EJB
                                             AWT           JMX
                  Swing
      EAR Struts          JAAS                       JCP
                 JavaBean
         NPE                                               Spring
     JAX-WS                 ENTERPRISE                       RMI
           JSE              JNI     JEE      SOA       NIO
                                                              JSP
       JSF JAXB   WAR  JNDI JDO
   JAX-RS JPQL EJBQL  JAF      POJO
                           JRE


Saturday, July 23, 2011
Saturday, July 23, 2011
Mas escala né?!



Saturday, July 23, 2011
Server Side



Saturday, July 23, 2011
JBoss
      Tomcat + Infinispan + HornetQ + Quartz + Clustering




Saturday, July 23, 2011
Hot Deployment



Saturday, July 23, 2011
Scala            Clojure
                                  Python


                                   JVM
                                   Ruby
            JavaScript                     Groovy




Saturday, July 23, 2011
Ruby
      Mais expressiva que Java




Saturday, July 23, 2011
DRY


Saturday, July 23, 2011
JRuby
                          Java + Ruby




Saturday, July 23, 2011
“You get true multithreading that
                 can use all your computer’s cores
                 from one process, plus a virtual
                 machine that’s been tuned for a
                 decade and a half.”

                             Using JRuby - Bringing Ruby to Java




Saturday, July 23, 2011
TorqueBox
                          “The power of JBoss with the
                            expressiveness of Ruby”
                                      Jim Crossley - MagicRuby Conference




Saturday, July 23, 2011
TorqueBox




Saturday, July 23, 2011
Instalação
                           TorqueBox do zero




Saturday, July 23, 2011
➜ jruby -S gem install torquebox torquebox-capistrano-support




Saturday, July 23, 2011
➜ wget http://torquebox.org/builds/LATEST/torquebox-dist-
      bin.zip
      ➜ unzip torquebox-dist-bin.zip

      ➜ export TORQUEBOX_HOME=$PWD/torquebox-1.x
      ➜ export JBOSS_HOME=$TORQUEBOX_HOME/jboss
      ➜ export JRUBY_HOME=$TORQUEBOX_HOME/jruby

      ➜ export PATH=$JRUBY_HOME/bin:$PATH




Saturday, July 23, 2011
Estrutura
      Diretórios do TorqueBox




Saturday, July 23, 2011
Rails
      rails new bazinga -m $TORQUEBOX_HOME/share/rails/template.rb




Saturday, July 23, 2011
Rake tasks
      rake torquebox:deploy
      rake torquebox:undeploy
      rake torquebox:run




Saturday, July 23, 2011
Deployment
                          Make knobs, not WAR!




Saturday, July 23, 2011
bazinga-knob.yml
      application:
       root: /home/bruno/app/bazinga
       env: development




Saturday, July 23, 2011
Scheduling
                          Agendamento de Jobs




Saturday, July 23, 2011
../app/jobs
      class JobDemo

         def initialize
          #Codigo de inicializacao
         end

       def run
        # O que você quer executar
       end
      end


Saturday, July 23, 2011
../config/torquebox.yml
      jobs:
       sync_agenda:
        job: JobDemo
        cron: '0 0 12 * * ?'
      end




Saturday, July 23, 2011
Mensageria
      Java Messaging Service + HornetQ




Saturday, July 23, 2011
Tasks
      class EmailerTask < TorqueBox::Messaging::Task
       def send_welcome(payload)
        to = "#{payload[:name]} <#{payload[:address]}>"
        # send welcome email to the user
       end
      end




Saturday, July 23, 2011
Tasks
      class UserController < ApplicationController
       def register
        user = User.new(params[:user])

        EmailerTask.async(:send_welcome, :address =>
      user.email, :name => user.name)
       end
      end




Saturday, July 23, 2011
messaging.yml
      /topics/print: PrintHandler
      /queues/students:
        PrintHandler:
         config:
          color: true




Saturday, July 23, 2011
Processors
      include TorqueBox::Messaging

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




Saturday, July 23, 2011
Queues
      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




Saturday, July 23, 2011
Serviços



Saturday, July 23, 2011
class BazingaService
       def initialize
        @queue = Messaging::Queue.new(“bazinga”)
       end
       def start
        @queue.publish “Testing”
       end

       def stop
        # O que fazer quando o serviço receber um stop
       end
      end




Saturday, July 23, 2011
CDI - Simplificado
                             Injeção de dependências




Saturday, July 23, 2011
Java
      package com.gurusp;

      public class Bazinga {
        //gets e sets
        public void say(String message) { // Execução do método }
      }

      Deploy do jar na aplicação
      app/
      models/
      views/
      controllers/
      lib/bazinga.jar




Saturday, July 23, 2011
Ruby
     class BazingaController < ApplicationController

           include TorqueBox::Injectors

           def create
            bazinga = inject(com.gurusp.Bazinga )
            bazinga.say “Ruby is for Java”
           end

     end




Saturday, July 23, 2011
Caching
      class BeersController < ApplicationController

         caches_action :most_popular, :expires_in => 30.seconds

         def most_popular
          @popular_beers = Beer.most_popular(:limit => 25)
         end

      end




Saturday, July 23, 2011
Saturday, July 23, 2011
Clustering
      ➜ $JBOSS_HOME/bin/run.sh -c all




Saturday, July 23, 2011
Cache distribuído!



Saturday, July 23, 2011
BackStage




Saturday, July 23, 2011
Comunidade
            irc.freenode.net #torquebox
            http://torquebox.org
            http://github.com/torquebox
            twitter: @torquebox

Saturday, July 23, 2011
Obrigado!
                                    @abstractj




  Creative  Commons  BY-­SA  3.0




Saturday, July 23, 2011

More Related Content

What's hot

TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
bobmcwhirter
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
Lance Ball
 
JRuby and You
JRuby and YouJRuby and You
JRuby and You
Hiro Asari
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRB
Hiro Asari
 
JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBox
marekgoldmann
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
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
Nick Sieger
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinder
marekgoldmann
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
jazzman1980
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011tobiascrawley
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
Burke Libbey
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
Hiro Asari
 
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 Back
Burke Libbey
 
Charla ruby nscodermad
Charla ruby nscodermadCharla ruby nscodermad
Charla ruby nscodermad
nscoder_mad
 
Ruby 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
Koichi Sasada
 
Hybrid Applications
Hybrid ApplicationsHybrid Applications
Hybrid Applications
Andreas Enbohm
 
Scala
ScalaScala
Java7 - Top 10 Features
Java7 - Top 10 FeaturesJava7 - Top 10 Features
Java7 - Top 10 Features
Andreas Enbohm
 

What's hot (20)

TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
JRuby and You
JRuby and YouJRuby and You
JRuby and You
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRB
 
JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBox
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
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
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinder
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
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
 
Charla ruby nscodermad
Charla ruby nscodermadCharla ruby nscodermad
Charla ruby nscodermad
 
First Day With J Ruby
First Day With J RubyFirst Day With J Ruby
First Day With J Ruby
 
Ruby 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
 
Hybrid Applications
Hybrid ApplicationsHybrid Applications
Hybrid Applications
 
Scala
ScalaScala
Scala
 
Java7 - Top 10 Features
Java7 - Top 10 FeaturesJava7 - Top 10 Features
Java7 - Top 10 Features
 

Similar to Torquebox - O melhor dos dois mundos

NodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebNodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebJakub Nesetril
 
Towards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltyTowards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabilty
kim.mens
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
John Stevenson
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Paul King
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
.toster
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
JAX London
 
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3
Michael Bleigh
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners
Paddy Lock
 
What python can learn from java
What python can learn from javaWhat python can learn from java
What python can learn from javajbellis
 
Einführung in Node.js
Einführung in Node.jsEinführung in Node.js
Einführung in Node.js
Sebastian Springer
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
Viliam Elischer
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on Android
Fernando Cejas
 
I know why your Java is slow
I know why your Java is slowI know why your Java is slow
I know why your Java is slow
aragozin
 
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
 
Deployment presentation
Deployment presentationDeployment presentation
Deployment presentationCorey Purcell
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDaum DNA
 

Similar to Torquebox - O melhor dos dois mundos (20)

NodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebNodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time Web
 
Towards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltyTowards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabilty
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners
 
What python can learn from java
What python can learn from javaWhat python can learn from java
What python can learn from java
 
Einführung in Node.js
Einführung in Node.jsEinführung in Node.js
Einführung in Node.js
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on Android
 
I know why your Java is slow
I know why your Java is slowI know why your Java is slow
I know why your Java is slow
 
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
 
Play framework
Play frameworkPlay framework
Play framework
 
Play 2 pip
Play 2 pipPlay 2 pip
Play 2 pip
 
Deployment presentation
Deployment presentationDeployment presentation
Deployment presentation
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascript
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Torquebox - O melhor dos dois mundos

  • 1. O melhor dos dois mundos Creative  Commons  BY-­SA  3.0 Saturday, July 23, 2011
  • 2. @abstractj Java há 12 anos, Ruby n00b TorqueBox Contributor Instrutor Caelum Saturday, July 23, 2011
  • 4. Java Come to the dark side Saturday, July 23, 2011
  • 6. JAXR Java-FX JAXP JSTL StAX JME JDOM JVM JAX-RPC EJB AWT JMX Swing EAR Struts JAAS JCP JavaBean NPE Spring JAX-WS ENTERPRISE RMI JSE JNI JEE SOA NIO JSP JSF JAXB WAR JNDI JDO JAX-RS JPQL EJBQL JAF POJO JRE Saturday, July 23, 2011
  • 10. JBoss Tomcat + Infinispan + HornetQ + Quartz + Clustering Saturday, July 23, 2011
  • 12. Scala Clojure Python JVM Ruby JavaScript Groovy Saturday, July 23, 2011
  • 13. Ruby Mais expressiva que Java Saturday, July 23, 2011
  • 15. JRuby Java + Ruby Saturday, July 23, 2011
  • 16. “You get true multithreading that can use all your computer’s cores from one process, plus a virtual machine that’s been tuned for a decade and a half.” Using JRuby - Bringing Ruby to Java Saturday, July 23, 2011
  • 17. TorqueBox “The power of JBoss with the expressiveness of Ruby” Jim Crossley - MagicRuby Conference Saturday, July 23, 2011
  • 19. Instalação TorqueBox do zero Saturday, July 23, 2011
  • 20. ➜ jruby -S gem install torquebox torquebox-capistrano-support Saturday, July 23, 2011
  • 21. ➜ wget http://torquebox.org/builds/LATEST/torquebox-dist- bin.zip ➜ unzip torquebox-dist-bin.zip ➜ export TORQUEBOX_HOME=$PWD/torquebox-1.x ➜ export JBOSS_HOME=$TORQUEBOX_HOME/jboss ➜ export JRUBY_HOME=$TORQUEBOX_HOME/jruby ➜ export PATH=$JRUBY_HOME/bin:$PATH Saturday, July 23, 2011
  • 22. Estrutura Diretórios do TorqueBox Saturday, July 23, 2011
  • 23. Rails rails new bazinga -m $TORQUEBOX_HOME/share/rails/template.rb Saturday, July 23, 2011
  • 24. Rake tasks rake torquebox:deploy rake torquebox:undeploy rake torquebox:run Saturday, July 23, 2011
  • 25. Deployment Make knobs, not WAR! Saturday, July 23, 2011
  • 26. bazinga-knob.yml application: root: /home/bruno/app/bazinga env: development Saturday, July 23, 2011
  • 27. Scheduling Agendamento de Jobs Saturday, July 23, 2011
  • 28. ../app/jobs class JobDemo def initialize #Codigo de inicializacao end def run # O que você quer executar end end Saturday, July 23, 2011
  • 29. ../config/torquebox.yml jobs: sync_agenda: job: JobDemo cron: '0 0 12 * * ?' end Saturday, July 23, 2011
  • 30. Mensageria Java Messaging Service + HornetQ Saturday, July 23, 2011
  • 31. Tasks class EmailerTask < TorqueBox::Messaging::Task def send_welcome(payload) to = "#{payload[:name]} <#{payload[:address]}>" # send welcome email to the user end end Saturday, July 23, 2011
  • 32. Tasks class UserController < ApplicationController def register user = User.new(params[:user]) EmailerTask.async(:send_welcome, :address => user.email, :name => user.name) end end Saturday, July 23, 2011
  • 33. messaging.yml /topics/print: PrintHandler /queues/students: PrintHandler: config: color: true Saturday, July 23, 2011
  • 34. Processors include TorqueBox::Messaging class PrintHandler < MessageProcessor   def on_message(body)     puts "Processing #{body} of #{message}"   end   def configure(opts)     @color = opts['color']   end end Saturday, July 23, 2011
  • 35. Queues 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 Saturday, July 23, 2011
  • 37. class BazingaService def initialize @queue = Messaging::Queue.new(“bazinga”) end def start @queue.publish “Testing” end def stop # O que fazer quando o serviço receber um stop end end Saturday, July 23, 2011
  • 38. CDI - Simplificado Injeção de dependências Saturday, July 23, 2011
  • 39. Java package com.gurusp; public class Bazinga { //gets e sets public void say(String message) { // Execução do método } } Deploy do jar na aplicação app/ models/ views/ controllers/ lib/bazinga.jar Saturday, July 23, 2011
  • 40. Ruby class BazingaController < ApplicationController include TorqueBox::Injectors def create bazinga = inject(com.gurusp.Bazinga ) bazinga.say “Ruby is for Java” end end Saturday, July 23, 2011
  • 41. Caching class BeersController < ApplicationController caches_action :most_popular, :expires_in => 30.seconds def most_popular @popular_beers = Beer.most_popular(:limit => 25) end end Saturday, July 23, 2011
  • 43. Clustering ➜ $JBOSS_HOME/bin/run.sh -c all Saturday, July 23, 2011
  • 46. Comunidade irc.freenode.net #torquebox http://torquebox.org http://github.com/torquebox twitter: @torquebox Saturday, July 23, 2011
  • 47. Obrigado! @abstractj Creative  Commons  BY-­SA  3.0 Saturday, July 23, 2011

Editor's Notes

  1. Experi&amp;#xEA;ncia com TorqueBox\nMotiva&amp;#xE7;&amp;#xF5;es\nMostrar um pouco como funciona\n
  2. non experient\nveio a pedido do vinny e rinaldi pra ensinar jsf pra voces\nexperiencia real de ter que juntar os dois mundos\n
  3. \n
  4. Surgiu em 1995 e causa medo at&amp;#xE9; hoje\nM&amp;#xE9;rito da Burocracia\nmito/medo de que Java &amp;#xE9; dificil\n
  5. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  6. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  7. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  8. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  9. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  10. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  11. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  12. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  13. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  14. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  15. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  16. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  17. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  18. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  19. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  20. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  21. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  22. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  23. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  24. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  25. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  26. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  27. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  28. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  29. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  30. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  31. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  32. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  33. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  34. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  35. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  36. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  37. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  38. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  39. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  40. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  41. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  42. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  43. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  44. \n
  45. \n
  46. WAS, glassfish, jboss. Necessidade de subir app java no mundo corp\n
  47. Enterprise the good parts. Apesar de todo buzzword existente no Java\nOs caras conseguiram juntar experiencia pra fazer coisas legais\nApresentar cada um\n
  48. \n
  49. Mesmo assim, come&amp;#xE7;aram a surgir v&amp;#xE1;rias linguagens em cima da vm\nAfinal, java nao resolve todos os problemas do mundo\nScala surgiu do descontentamento com java por exemplo\n
  50. Sintaxe mais clara, limpa. Expressiva\nProdutividade com rails\nBom, todo mundo aqui sabe que ruby &amp;#xE9; legal certo?\n
  51. Os problemas s&amp;#xE3;o os mesmos, resolvemos com nomes diferentes\nProblemas j&amp;#xE1; resolvidos: escalabilidade, mensageria, clustering, schedule...\nPorque n&amp;#xE3;o tirar proveito do java e do ruby?\n
  52. \n
  53. \n
  54. Criado em 2008\nPatrocinado pela RedHat\n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. O que &amp;#xE9; preciso fazer no servidor? NADA, ele nao exige redeploy\n
  67. \n
  68. Inspirado no DelayedJobs\n
  69. O que &amp;#xE9; preciso fazer no servidor? NADA, ele nao exige redeploy\n
  70. Inspirado no DelayedJobs\n
  71. \n
  72. \n
  73. \n
  74. O que &amp;#xE9; preciso fazer no servidor? NADA, ele nao exige redeploy\n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n