SlideShare ist ein Scribd-Unternehmen logo
1 von 58
The Polyglot Future
    of JBoss AS
       Toby Crawley
       Red Hat, Inc.
Present
The Polyglot Future
    of JBoss AS
       Toby Crawley
       Red Hat, Inc.
Yours Truly
• Senior SW Engineer at Red Hat
• Core developer on TorqueBox &
  Immutant
• Member of Project:Odd
• @tcrawley
Agenda
• intro
• JBoss AS
• JRuby & TorqueBox
• Clojure & Immutant
• crap, a demo
• outro
JBoss AS 7
• Low memory footprint
• Modularized class loader isolation
• Fast startup time
• Performant
• EE6
“Java is a DSL for taking
large XML files and
converting them to stack
traces”
                   Scott Bellware
Goal

Leverage the AS as a platform to reduce some of
 the accidental complexity of your deployment
       environment and allow you to use
            the best tool for the job.
Goal


To make you more productive.
Goal


To make you happy.
Ruby
• Expressive
• Dynamic typing
• Less ceremony
• Makes you feel more cleverer
Set<Person> people = new HashSet<Person>();

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

for ( Person each : people ) {
  each.promote();
}
teams.
 collect(&:members).
 flatten.uniq.each(&:promote!)
JRuby
• Real threads
• Simple access to Java
• Fastest Ruby implementation
require 'java'

bar = org.projectodd.foo.Bar.new
bar.a_value = 42
bar.bazerize
TorqueBox is an Application Server for
Ruby built on top of JBoss AS7
Ruby!APIs!/!Programming!Models                               Java!APIs!/!Programming!Models

                                            Message
                                           Processors
                                                              Polyglot
                         WebSockets                           Injection
Sinatra      Rails                            Jobs
                          STOMP                                             POJO        REST      Servlet

      Rack                   Daemons         Tasks                          Spring      JMS       JavaEE


          JRuby!Component!Deployers!&!Gems                                   Java!Enterprise!Services

                                                                                     JBoss Web
           Messaging

                                                                                     Infinispan
             Cache
                                       TorqueBox                                      HornetQ
          Transactions                    Core
                                                                                      Quartz

            Security                   TorqueBox
                                          Core                                       PicketLink



            JRuby with JIT                                   Managed Services Container


                                           Java Virtual Machine
Web

Supports any Rack framework (Rails,
Sinata, Padrino, etc). Requests come in,
responses go out. Works like you would
expect...
Web


...but no war required. Just point
TorqueBox at the application root.
Scheduled Jobs


Simple cron-like scheduling that shares
your application's lifecycle.
Scheduled Jobs

class TPSReportJob

 def run
  # work happens here
 end

end
Scheduled Jobs

TorqueBox.configure do

 job TPSReportJob,
    :cron => '0 */5 * * * ?'

end
Backgroundable


Asynchronous execution with a simple
api. Shares your application's lifecycle.
Backgroundable
include TorqueBox::Messaging

class User
  include Backgroundable

 always_background :send_welcome

 def send_welcome
  # slow email process
 end

end
Messaging



Layered on top of JMS and HornetQ.
Useful for decoupling or polyglot interop.
Messaging

queue = inject( '/queue/morris_day' )

queue.publish( Time.now )

puts queue.receive

# Fri Dec 2 16:44:22 -0500 2011
Messaging
include TorqueBox::Messaging

class TheTime < MessageProcessor

 def on_message(body)
  # What time is it?!?
  puts body
 end

end
Messaging

TorqueBox.configure do

 queue '/queue/morris_day' do
   processor TheTime
 end

end
Services



Long running daemons that share the
application's lifecycle.
Injection


aka Inversion of Control. Telling the
container what you need and letting it
wire things up.
Distributed
          Transactions


True multi-resource distributed
transactions.
Things I Skipped
• Built-in WebSockets
• Simple clustering
• Key/Value store via Infinispan
  (Caching)
Clojure
• Modern Lisp for the JVM
• Functional
• Immutable data
• Concise syntax
• Nice Java integration
Set<Person> people = new HashSet<Person>();

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

for ( Person each : people ) {
  each.promote();
}
(map promote!
 (set (extract :members teams)))
(def extract mapcat)
(map promote!
 (set (extract :members teams)))
(doto
 (org.projectodd.foo.Bar.)
 (.setAValue 42)
 (.bazerize))
Immutant
Immutant is an Application Server for
Clojure being built on top of JBoss AS7
Web

Supports Ring handlers. Works like you
would expect. Requests come in,
responses go out. Endpoints can be
created dynamically.
Web

(require '[immutant.web :as web])

(defn my-ring-handler [request]
 ;; process request here)

(web/start "/" my-ring-handler)
...
(web/stop "/")
Messaging



Layered on top of JMS and HornetQ.
Useful for decoupling or polyglot interop.
Messaging
(require
  '[immutant.messaging :as msg])

(def q "/queue/morris_day")

(msg/start q)

(msg/publish q (Date.))

(println (msg/receive q))

; #<Date Fri Dec 2 16:54:56 EST 2011>
Messaging

(msg/listen "/queue/morris_day"
 (fn [body]
   ;; What time is it?!?
   (println body)))
Daemons



Long running daemons that share the
application's lifecycle.
Coming Soon
• Scheduled Jobs
• Distributed futures
• Distributed state
• Multi-resource transactions
• Injection
• You tell us!
http://www.flickr.com/photos/-lucaslove/5084345964/
http://www.flickr.com/photos/jdgoring/179412740/
Clojure
twitter
                       daemon



                        queue



           Ruby                                 Java


          processor                           TweetClassifier



                      web
            topic     sockets          you!

                                                    and you?
                                and you!
Language     LOC
  Ruby       ~110
 Clojure     ~50
  Java       ~30
Javascript   ~25
Availability
• TorqueBox: 2.0.0.beta1 released today
• Immutant: incremental builds available
Availability
                              Monday
• TorqueBox: 2.0.0.beta1 released today
• Immutant: incremental builds available
http://www.flickr.com/photos/daveynin/4194763701/
Resources
• http://torquebox.org
• #torquebox on freenode
• @torquebox
• http://immutant.org
• #immutant on freenode
• @immutants
http://www.flickr.com/photos/thaths/3760407774/

Weitere ähnliche Inhalte

Was ist angesagt?

Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
tobiascrawley
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011
tobiascrawley
 
Torquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundosTorquebox - O melhor dos dois mundos
Torquebox - O melhor dos dois mundos
Bruno Oliveira
 
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
benbrowning
 
Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011
tobiascrawley
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
FuseSource.com
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 2011
Marcelo Jabali
 

Was ist angesagt? (20)

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
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
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
 
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
 
Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011
 
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
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
Ruby 1.9 Fibers
Ruby 1.9 FibersRuby 1.9 Fibers
Ruby 1.9 Fibers
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 
Fiber in the 10th year
Fiber in the 10th yearFiber in the 10th year
Fiber in the 10th year
 
Ruby 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
 
Apache camel overview dec 2011
Apache camel overview dec 2011Apache camel overview dec 2011
Apache camel overview dec 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
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 

Ähnlich wie Devignition 2011

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
OpenBlend society
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
Joe Kutner
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
Tom Croucher
 
Optimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer ToolsOptimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer Tools
Amazon Web Services
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Kyle Drake
 

Ähnlich wie Devignition 2011 (20)

Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
You Call that Micro, Mr. Docker? How OSv and Unikernels Help Micro-services S...
 
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusD. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
 
Deploying JRuby Web Applications
Deploying JRuby Web ApplicationsDeploying JRuby Web Applications
Deploying JRuby Web Applications
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Celery: The Distributed Task Queue
Celery: The Distributed Task QueueCelery: The Distributed Task Queue
Celery: The Distributed Task Queue
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
Optimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer ToolsOptimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer Tools
 
Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyFast, concurrent ruby web applications with EventMachine and EM::Synchrony
Fast, concurrent ruby web applications with EventMachine and EM::Synchrony
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Devignition 2011

Hinweis der Redaktion

  1. \n
  2. \n
  3. You! - java, other jvm langs, ruby, clojure\n\n
  4. Fire up your laptops\n
  5. JBoss, AS, AS7\n
  6. \n
  7. JVM is a platform\n
  8. &quot;just as the JVM...&quot;\n
  9. distill\nnot for the boss, but for your own happiness\n
  10. distill further\n
  11. \n
  12. \n
  13. a comparison\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. 1) teaches the AS how to deploy ruby apps\n2) exposes AS functionality via ruby interfaces\nstill run java (multiple apps)\n
  19. &quot;skimming the surface&quot;\n&quot;in the room&quot;\n
  20. \n
  21. \n
  22. \n
  23. \n
  24. First look at torquebox.rb\n
  25. \n
  26. Mention Futures\n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. first class\ndefined a symbol pointing to the mapcat function\n
  40. \n
  41. \n
  42. 1) teaches the AS how to deploy clojure apps\n2) exposes AS functionality via clojure interfaces\njava too!\n
  43. mention no war\n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. WIP\navout\n
  51. Each are just modules added to the AS, so we can overlay\n
  52. wish me luck! (shout?)\nCMD-TAB\n
  53. \n
  54. focus on solving the problem, not the platform\n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. try it out, find bugs\n
  61. try it out, find bugs\n
  62. we&apos;ve talked about TB &amp; I, and how they work\nand how they can be used together to build polyglot apps\nHopefully compelling\nif you try it, maybe we can make you happy\n\n
  63. torquebox docs\nsausage, help\n(services story if there is time)\n
  64. I have stickers!\nAre we still running?\n