SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
News from




Andrea Leoncini
JBoss Solution Architect


October 12, 2009
Agenda

        Annunci
        REST
        Infinispan
        HornetQ




Andrea Leoncini            News from JBoss World
Tre annunci
                  durante la manifestazione

        L'uscita della versione 5 Enterprise
        La certificazione JBoss Administrator
        Il progetto GateIn




Andrea Leoncini                                  News from JBoss World
Other interesting stuff

        Accelerate your JBoss – Andy Miller
        JBoss and all of its OSGi flavours – Alex Justin
        Large Clusters in JBoss – Bela Ban
        Extending JOPR – Heiko W. Rupp
        Writing Telco Applications with JBCP – Jean Deruelle
        JBoss 6 – Jason T. Green
        JBPM explained – Tom Baeyens
        Beyond Rails with TorqueBox – Bob Mc Whirter
        ...and much more

      http://www.redhat.com/promo/summit/2009/highlights/


Andrea Leoncini                                         News from JBoss World
What is REST?

      REpresentational State Transfer
        ●   PhD by Roy Fielding
      REST answers the questions of
        ●   Why is the Web so prevalent and ubiquitous?
        ●   What makes the Web scale?
        ●   How can I apply the architecture of the web to my
            applications?




Andrea Leoncini                                           News from JBoss World
What is REST?

      REST is a set of architectural principles
      REST isn’t protocol specific
        ●   But, usually REST == REST + HTTP
      A different way to look at writing Web Services
        ●   Many say it’s the anti-WS-*




Andrea Leoncini                                      News from JBoss World
What is REST?

        Addressable Resources
           ●   Every “thing” should have a URI
        Constrained interface
           ●   Use the standard methods of the protocol
           ●   HTTP: GET, POST, PUT, DELETE, etc.
        Representation Oriented
        Communicate statelessly
           ●   Stateless application scale




Andrea Leoncini                                           News from JBoss World
What is REST?

        Use URIs
           ●   Every endpoint/thing has a URI
        Linkability
           ●   Resource representations have a standardized way of
               referencing other resource representations
           ●   Representations have a standardized way to compose
               themselves:




Andrea Leoncini                                           News from JBoss World
REST Linkability


  <order id=“111”>
    <customer>32133</customer>
    <order-entries>
       <order-entry>
          <quantity>5</quantity>
          <product>7811</product>
  …



  <order id=“111”>
    <customer>http://sales.com/customers/32133</customer>
    <order-entries>
       <order-entry>
          <quantity>5</quantity>
          <product>http://sales.com/products/7811</product>
  …



Andrea Leoncini                                   News from JBoss World
Constrained, Uniform Interface


      The idea is to have a well-defined, fixed, finite set of operations
           Resources can only use these operations
           Each operation has well-defined, explicit behavior
           In HTTP land, these methods are GET, POST, PUT, DELETE
      How can we build applications with only 4+ methods?
           SQL only has 4 operations: INSERT, UPDATE, SELECT, DELETE
           JMS has a well-defined, fixed set of operations
           Both are pretty powerful and useful APIs with constrained
            interfaces




Andrea Leoncini                                                  News from JBoss World
REST in Conclusion

      REST answers questions of
        ●   Why does the Web scale?
        ●   Why is the Web so ubiquitous?
        ●   How can I apply the architecture of the Web to my applications?
      REST is the Re-birth of HTTP
      Promises
        ●   Simplicity
        ●   Interoperability
        ●   Platform independence
        ●   Change resistance




Andrea Leoncini                                                News from JBoss World
JAX-RS

      JCP Specification
        ●   Lead by Sun, Marc Hadley
        ●   Finished in September 2008
      Annotation Framework
      Dispatch URI’s to specific classes and methods that can
       handle requests
      Allows you to map HTTP requests to method invocations
      IMO, a beautiful example of the power of parameter
       annotations
      Nice URI manipulation functionality



Andrea Leoncini                                         News from JBoss World
JAX-RS Annotations

      @Path
        ●   Defines URI mappings and templates
      @Produces, @Consumes
        ●   What MIME types does the resource produce and consume
      @GET, @POST, @DELETE, @PUT, @HEAD
        ●   Identifies which HTTP method the Java method is
            interested in




Andrea Leoncini                                          News from JBoss World
JAX-RS Parameter Annotations
     @PathParam
          Allows you to extract URI parameters/named URI template
           segments
     @QueryParam
          Access to specific parameter URI query string
     @HeaderParam
          Access to a specific HTTP Header
     @CookieParam
          Access to a specific cookie value
     Above annotations can automatically map HTTP request values to
          String and primitive types
          Class types with String constructor or a static valueOf(String val)
           method
          List or Arrays of above types when there are multiple values
     @Context


Andrea Leoncini                                                  News from JBoss World
JAX-RS: GET /orders/3323


     @Path(“/orders”)
     public class OrderService {

          @Path(“/{order-id}”)
          @GET
          @Produces(“application/xml”)
          String getOrder(@PathParam(“order-id”) int id) {
            …
          }
     }




Andrea Leoncini                                       News from JBoss World
JAX-RS Resource Classes

      JAX-RS annotations are used on POJO classes
      The default component lifecycle is per-request
        ●   Same idea as @Stateless EJBs
        ●   Singletons supported too
        ●   EJB integration defined in EE 6
        ●   Most implementations have Spring integration
      Root resources identified via @Path annotation on class




Andrea Leoncini                                            News from JBoss World
JAX-RS: GET /orders/3323

  @Path(“/orders”)
                                         Base URI path to resource
  public class OrderService {

       @Path(“/{order-id}”)
       @GET
       @Produces(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




Andrea Leoncini                                          News from JBoss World
JAX-RS: GET /orders/3323

  @Path(“/orders”)
  public class OrderService {          Additional URI pattern
                                   that getOrder() method maps to

       @Path(“/{order-id}”)
       @GET
       @ProduceMime(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




Andrea Leoncini                                           News from JBoss World
JAX-RS: GET /orders/3323
  @Path(“/orders”)
  public class OrderService {         Defines a URI path segment
                                               pattern

       @Path(“/{order-id}”)
       @GET
       @Produces(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




Andrea Leoncini                                           News from JBoss World
JAX-RS: GET /orders/3323
  @Path(“/orders”)
  public class OrderService {

       @Path(“/{order-id}”)           HTTP method Java getOrder()
       @GET                                     maps to
       @Produces(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




Andrea Leoncini                                            News from JBoss World
JAX-RS: GET /orders/3323
                                       What’s the CONTENT-TYPE
  @Path(“/orders”)                            returned?
  public class OrderService {

       @Path(“/{order-id}”)
       @GET
       @Produces(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




Andrea Leoncini                                          News from JBoss World
JAX-RS: GET /orders/3323
  @Path(“/orders”)
  public class OrderService {

       @Path(“/{order-id}”)
       @GET
       @Produces(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




                  Inject value of URI segment
                   into the id Java parameter




Andrea Leoncini                                      News from JBoss World
JAX-RS: GET /orders/3323
  @Path(“/orders”)
  public class OrderService {

       @Path(“/{order-id : d+}”)
       @GET
       @Produces(“application/xml”)
       String getOrder(@PathParam(“order-id”) int id) {
         …
       }
  }




                                        Automatically convert URI
                                     string segment into an integer




Andrea Leoncini                                          News from JBoss World
JAX-RS: POST /orders

  @Path(“/orders”)                     What CONTENT-TYPE is this
  public class OrderService {        method expecting from client?

       @POST
       @Consumes(“application/xml”)
       void submitOrder(String orderXml) {
         …
       }
  }




Andrea Leoncini                                           News from JBoss World
JAX-RS: POST /orders


  @Path(“/orders”)
  public class OrderService {

       @POST
       @Consumes(“application/xml”)
       void submitOrder(Order orderXml) {
         …
       }
  }




                              Un-annotated parameters assumed
                               to be incoming message body.
                                   There can be only one!




Andrea Leoncini                                                 News from JBoss World
JAX-RS Implementations

      JBoss RESTEasy
           http://jboss.org/resteasy
           Embeddable
           Spring and EJB integration
           Client Framework
           Asynchronous HTTP abstractions
      Jersey
           Sun reference implementation
           WADL support
      Apache CXF
      RESTLet


Andrea Leoncini                              News from JBoss World
References

       Links

           http://jsr311.dev.java.net/
           http://jboss.org/resteasy
           http://rest.blueoxen.net/
           http://java.dzone.com/articles/intro-rest
           http://architects.dzone.com/articles/putting-java-rest
       Books
           Coming this fall “RESTFul Java” by me
           O’Reilly’s “RESTful Web Services”
           http://oreilly.com/catalog/9780596529260/




Andrea Leoncini                                             News from JBoss World
Infinispan




Andrea Leoncini                News from JBoss World
Cloud Computing

        Clouds are happening
        You cannot escape them! ;)
        Traditional datacenters will be marginalized to niche
         deployments
        Clouds become mainstream




Andrea Leoncini                                       News from JBoss World
Why are clouds popular?

    ●
        Piecemeal cost
         ●
             Pay for what you use
    ●
        Massive, global data centers means high availability,
         instant backups
    ●
        Everyone benefits from economies of scale
    ●
        Ability to scale on demand
    ●
        Very fast provisioning
    ●
        Proven charging model
         ●
             Remember timesharing on mainframes?


Andrea Leoncini                                      News from JBoss World
Data Storage

    ●
        Clouds are inherently stateless and ephemeral
    ●
        Databases on clouds don't make sense
         ●
             Traditional modes of data storage won't work
    ●
        Scalability is crucial
         ●
             Databases still are a bottleneck
         ●
             … and single point of failure!




Andrea Leoncini                                             News from JBoss World
Trying to make databases work in the cloud

    ●
        Native database clustering
         ●
             Notoriously slow and non-scalable
         ●
             Unreliable
         ●
             Expensive!
         ●
             Need special hardware, e.g., SAN




Andrea Leoncini                                    News from JBoss World
The solution: Data Grids!

    ●
        Data grids are perfect for clouds
         ●
             Highly scalable
         ●
             No single point of failure
         ●
             Works with ephemeral nodes
         ●
             Very low latency
    ●
        Data grids
         ●
             Amazon SimpleDB uses Dynamo
         ●
             Infinispan, etc.
         ●
             Many other commercial and open source offerings


Andrea Leoncini                                        News from JBoss World
Introducing Infinispan

    ●
        Highly scalable data grid platform
         ●
             100% open source licensed (LGPL)
         ●
             Based on some JBoss Cache code
              ●
                  But mostly all-new!
    ●
        JBoss Cache is a clustered caching library
         ●
             Infinispan is a data grid platform
    ●
        JBoss Cache uses a tree-structured API
         ●
             Infinispan is a Map. Like JSR-107’s JCACHE




Andrea Leoncini                                        News from JBoss World
Infinispan != JBoss Cache 4
    ●
        Internal data container design completely different
    ●
        APIs completely different
    ●
        Not backward-compatible
         ●
             Although an code-level compatibility layer is available




Andrea Leoncini                                            News from JBoss World
More scalable than JBoss Cache

    ●
        Internal structures more memory efficient
         ●
             Data organised in Map-like structures
              ●
                  Making use of CAS
              ●
                  minimising synchronized blocks, mutexes
         ●
             Containers are naturally ordered
              ●
                  Makes eviction much more efficient
    ●
        Uses JBoss Marshalling
         ●
             Smaller payloads + poolable streams = faster remote
              calls




Andrea Leoncini                                             News from JBoss World
“Borrowed” from JBoss Cache

         ●
             JTA transactions
         ●
             Replicated data structure
         ●
             Eviction, cache persistence
         ●
             Notifications and eventing API
         ●
             JMX reporting
         ●
             Fine-grained replication
         ●
             MVCC locking
         ●
             Non-blocking state transfer techniques
         ●
             Query API
         ●
             Custom (non-JDK) marshalling
Andrea Leoncini                                       News from JBoss World
… and new features!

         ●
             Consistent hash based data distribution
         ●
             Much simpler Map API (JSR-107 compliant)
         ●
             JPA API
         ●
             Client/server module with memcached
              compatibility
         ●
             REST API
         ●
             Ability to be consumed by non-JVM platforms
         ●
             JOPR based GUI management console
         ●
             Distributed executors
              ●
                  Map/reduce programming model made easy!

Andrea Leoncini                                        News from JBoss World
Distributed Cache

    ●
        Consistent hash based data distribution
         ●
             Will allow us to scale to bigger clusters
         ●
             Goal of efficient scaling to 1000’s of nodes
    ●
        Lightweight, “L1” cache for efficient reads
         ●
             On writes, “L1” gets invalidated
    ●
        Dynamic rebalancing




Andrea Leoncini                                             News from JBoss World
jboss.org/hornetq


   H


      HornetQ is the new name for JBoss Messaging 2
      HornetQ is an open source community project to build a
       multi-protocol asynchronous messaging system
      HornetQ is designed for performance
      HornetQ is designed with usability in mind
      HornetQ is full featured
      See the wiki for more information:
       http://www.jboss.org/community/wiki/HornetQGeneralFAQs




Andrea Leoncini                                          News from JBoss World
How does HornetQ relate to
                  JBoss Messaging?
      We decided to rename JBoss Messaging 2 to HornetQ
      JBM 1.x and 2.x code bases 95%+ different.
      HornetQ is a different beast to JBM 1.x
      HornetQ is not tightly coupled to JBoss Application
       Server




Andrea Leoncini                                      News from JBoss World
Both standalone and JEE messaging

      HornetQ is a fully functional stand-alone messaging
       server – if you don't want an app server, don't use an
       app server
      HornetQ can also be integrated with any JEE application
       server, e.g. JBoss Application Server 5.0, using its JCA
       adaptor
      HornetQ can also be used with any dependency injection
       framework, e.g. JBoss MC, Spring, Google Guice




Andrea Leoncini                                      News from JBoss World
HornetQ features

      Very high performance journal
      Support for huge queues and huge messages with small
       server and client footprint
      Pluggable transport system
      Seamless High Availability (HA)
      Massively flexible clustering
      Extensive management API
      Lots, lots, more, but no time here! See the wiki for a full
       list:
       http://www.jboss.org/community/wiki/HornetQFeatures




Andrea Leoncini                                        News from JBoss World
Ultra high performance journal

      HornetQ persistence is very fast
      Very fast store using Linux asynchronous IO.
      Up to 100+ MiB/s on a single node!
      JNI interface to aio library (libaio), encapsulated in
       Java package.
      Automatic switches to Java NIO when not running
       on Linux




Andrea Leoncini                                     News from JBoss World
Huge queues and messages

      HornetQ supports huge queues – far bigger than
       can fit in available RAM
      Run Terabyte queues while the server is only
       running in 50MiB of RAM!
      Send and receive huge multi-gigabyte messages
       with all the normal transactional semantics
      Effectively, only limit to message size is
       available disk space. We have tested messages
       up to 8 GiB in size.




Andrea Leoncini                              News from JBoss World
Configurable Transport system

      Fully pluggable transport
      Ships with default implementation using JBoss Netty
       http://jboss.org/netty/
      TCP transport
      SSL transport
      HTTP transport
      Servlet transport
      In-VM transport




Andrea Leoncini                                    News from JBoss World
News from




                  Grazie!

andrea.leoncini@redhat.com

Weitere ähnliche Inhalte

Ähnlich wie October 2009 - News From JBoss World 09

JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
Shreedhar Ganapathy
 
Building Restful Web Services with Java
Building Restful Web Services with JavaBuilding Restful Web Services with Java
Building Restful Web Services with Java
Vassil Popovski
 

Ähnlich wie October 2009 - News From JBoss World 09 (20)

Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy ClarksonMulti Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Network Device Database Management with REST using Jersey
Network Device Database Management with REST using JerseyNetwork Device Database Management with REST using Jersey
Network Device Database Management with REST using Jersey
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with OData
 
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
 
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RSSpark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RS
 
XML Technologies for RESTful Services Development
XML Technologies for RESTful Services DevelopmentXML Technologies for RESTful Services Development
XML Technologies for RESTful Services Development
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
JAX-RS Creating RESTFul services
JAX-RS Creating RESTFul servicesJAX-RS Creating RESTFul services
JAX-RS Creating RESTFul services
 
RESTful Web services using JAX-RS
RESTful Web services using JAX-RSRESTful Web services using JAX-RS
RESTful Web services using JAX-RS
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
 
Building Restful Web Services with Java
Building Restful Web Services with JavaBuilding Restful Web Services with Java
Building Restful Web Services with Java
 
Entity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applicationsEntity provider selection confusion attacks in JAX-RS applications
Entity provider selection confusion attacks in JAX-RS applications
 

Mehr von JBug Italy

JBoss AS7 Overview
JBoss AS7 OverviewJBoss AS7 Overview
JBoss AS7 Overview
JBug Italy
 

Mehr von JBug Italy (20)

JBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testingJBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testing
 
Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBoss
 
AS7 and CLI
AS7 and CLIAS7 and CLI
AS7 and CLI
 
Intro jbug milano_26_set2012
Intro jbug milano_26_set2012Intro jbug milano_26_set2012
Intro jbug milano_26_set2012
 
Faster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzFaster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzz
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
 
AS7
AS7AS7
AS7
 
JBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logicJBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logic
 
JBoss AS7 Overview
JBoss AS7 OverviewJBoss AS7 Overview
JBoss AS7 Overview
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012
 
JBoss AS7 Webservices
JBoss AS7 WebservicesJBoss AS7 Webservices
JBoss AS7 Webservices
 
JBoss AS7
JBoss AS7JBoss AS7
JBoss AS7
 
Intro JBug Milano - September 2011
Intro JBug Milano - September 2011Intro JBug Milano - September 2011
Intro JBug Milano - September 2011
 
All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMS
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
 
Drools Introduction
Drools IntroductionDrools Introduction
Drools Introduction
 
September 2010 - Arquillian
September 2010 - ArquillianSeptember 2010 - Arquillian
September 2010 - Arquillian
 
September 2010 - Gatein
September 2010 - GateinSeptember 2010 - Gatein
September 2010 - Gatein
 
May 2010 - Infinispan
May 2010 - InfinispanMay 2010 - Infinispan
May 2010 - Infinispan
 
May 2010 - Drools flow
May 2010 - Drools flowMay 2010 - Drools flow
May 2010 - Drools flow
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
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, ...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

October 2009 - News From JBoss World 09

  • 1. News from Andrea Leoncini JBoss Solution Architect October 12, 2009
  • 2. Agenda  Annunci  REST  Infinispan  HornetQ Andrea Leoncini News from JBoss World
  • 3. Tre annunci durante la manifestazione  L'uscita della versione 5 Enterprise  La certificazione JBoss Administrator  Il progetto GateIn Andrea Leoncini News from JBoss World
  • 4. Other interesting stuff  Accelerate your JBoss – Andy Miller  JBoss and all of its OSGi flavours – Alex Justin  Large Clusters in JBoss – Bela Ban  Extending JOPR – Heiko W. Rupp  Writing Telco Applications with JBCP – Jean Deruelle  JBoss 6 – Jason T. Green  JBPM explained – Tom Baeyens  Beyond Rails with TorqueBox – Bob Mc Whirter  ...and much more http://www.redhat.com/promo/summit/2009/highlights/ Andrea Leoncini News from JBoss World
  • 5. What is REST?  REpresentational State Transfer ● PhD by Roy Fielding  REST answers the questions of ● Why is the Web so prevalent and ubiquitous? ● What makes the Web scale? ● How can I apply the architecture of the web to my applications? Andrea Leoncini News from JBoss World
  • 6. What is REST?  REST is a set of architectural principles  REST isn’t protocol specific ● But, usually REST == REST + HTTP  A different way to look at writing Web Services ● Many say it’s the anti-WS-* Andrea Leoncini News from JBoss World
  • 7. What is REST?  Addressable Resources ● Every “thing” should have a URI  Constrained interface ● Use the standard methods of the protocol ● HTTP: GET, POST, PUT, DELETE, etc.  Representation Oriented  Communicate statelessly ● Stateless application scale Andrea Leoncini News from JBoss World
  • 8. What is REST?  Use URIs ● Every endpoint/thing has a URI  Linkability ● Resource representations have a standardized way of referencing other resource representations ● Representations have a standardized way to compose themselves: Andrea Leoncini News from JBoss World
  • 9. REST Linkability <order id=“111”> <customer>32133</customer> <order-entries> <order-entry> <quantity>5</quantity> <product>7811</product> … <order id=“111”> <customer>http://sales.com/customers/32133</customer> <order-entries> <order-entry> <quantity>5</quantity> <product>http://sales.com/products/7811</product> … Andrea Leoncini News from JBoss World
  • 10. Constrained, Uniform Interface  The idea is to have a well-defined, fixed, finite set of operations  Resources can only use these operations  Each operation has well-defined, explicit behavior  In HTTP land, these methods are GET, POST, PUT, DELETE  How can we build applications with only 4+ methods?  SQL only has 4 operations: INSERT, UPDATE, SELECT, DELETE  JMS has a well-defined, fixed set of operations  Both are pretty powerful and useful APIs with constrained interfaces Andrea Leoncini News from JBoss World
  • 11. REST in Conclusion  REST answers questions of ● Why does the Web scale? ● Why is the Web so ubiquitous? ● How can I apply the architecture of the Web to my applications?  REST is the Re-birth of HTTP  Promises ● Simplicity ● Interoperability ● Platform independence ● Change resistance Andrea Leoncini News from JBoss World
  • 12. JAX-RS  JCP Specification ● Lead by Sun, Marc Hadley ● Finished in September 2008  Annotation Framework  Dispatch URI’s to specific classes and methods that can handle requests  Allows you to map HTTP requests to method invocations  IMO, a beautiful example of the power of parameter annotations  Nice URI manipulation functionality Andrea Leoncini News from JBoss World
  • 13. JAX-RS Annotations  @Path ● Defines URI mappings and templates  @Produces, @Consumes ● What MIME types does the resource produce and consume  @GET, @POST, @DELETE, @PUT, @HEAD ● Identifies which HTTP method the Java method is interested in Andrea Leoncini News from JBoss World
  • 14. JAX-RS Parameter Annotations  @PathParam  Allows you to extract URI parameters/named URI template segments  @QueryParam  Access to specific parameter URI query string  @HeaderParam  Access to a specific HTTP Header  @CookieParam  Access to a specific cookie value  Above annotations can automatically map HTTP request values to  String and primitive types  Class types with String constructor or a static valueOf(String val) method  List or Arrays of above types when there are multiple values  @Context Andrea Leoncini News from JBoss World
  • 15. JAX-RS: GET /orders/3323 @Path(“/orders”) public class OrderService { @Path(“/{order-id}”) @GET @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Andrea Leoncini News from JBoss World
  • 16. JAX-RS Resource Classes  JAX-RS annotations are used on POJO classes  The default component lifecycle is per-request ● Same idea as @Stateless EJBs ● Singletons supported too ● EJB integration defined in EE 6 ● Most implementations have Spring integration  Root resources identified via @Path annotation on class Andrea Leoncini News from JBoss World
  • 17. JAX-RS: GET /orders/3323 @Path(“/orders”) Base URI path to resource public class OrderService { @Path(“/{order-id}”) @GET @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Andrea Leoncini News from JBoss World
  • 18. JAX-RS: GET /orders/3323 @Path(“/orders”) public class OrderService { Additional URI pattern that getOrder() method maps to @Path(“/{order-id}”) @GET @ProduceMime(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Andrea Leoncini News from JBoss World
  • 19. JAX-RS: GET /orders/3323 @Path(“/orders”) public class OrderService { Defines a URI path segment pattern @Path(“/{order-id}”) @GET @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Andrea Leoncini News from JBoss World
  • 20. JAX-RS: GET /orders/3323 @Path(“/orders”) public class OrderService { @Path(“/{order-id}”) HTTP method Java getOrder() @GET maps to @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Andrea Leoncini News from JBoss World
  • 21. JAX-RS: GET /orders/3323 What’s the CONTENT-TYPE @Path(“/orders”) returned? public class OrderService { @Path(“/{order-id}”) @GET @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Andrea Leoncini News from JBoss World
  • 22. JAX-RS: GET /orders/3323 @Path(“/orders”) public class OrderService { @Path(“/{order-id}”) @GET @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Inject value of URI segment into the id Java parameter Andrea Leoncini News from JBoss World
  • 23. JAX-RS: GET /orders/3323 @Path(“/orders”) public class OrderService { @Path(“/{order-id : d+}”) @GET @Produces(“application/xml”) String getOrder(@PathParam(“order-id”) int id) { … } } Automatically convert URI string segment into an integer Andrea Leoncini News from JBoss World
  • 24. JAX-RS: POST /orders @Path(“/orders”) What CONTENT-TYPE is this public class OrderService { method expecting from client? @POST @Consumes(“application/xml”) void submitOrder(String orderXml) { … } } Andrea Leoncini News from JBoss World
  • 25. JAX-RS: POST /orders @Path(“/orders”) public class OrderService { @POST @Consumes(“application/xml”) void submitOrder(Order orderXml) { … } } Un-annotated parameters assumed to be incoming message body. There can be only one! Andrea Leoncini News from JBoss World
  • 26. JAX-RS Implementations  JBoss RESTEasy  http://jboss.org/resteasy  Embeddable  Spring and EJB integration  Client Framework  Asynchronous HTTP abstractions  Jersey  Sun reference implementation  WADL support  Apache CXF  RESTLet Andrea Leoncini News from JBoss World
  • 27. References  Links  http://jsr311.dev.java.net/  http://jboss.org/resteasy  http://rest.blueoxen.net/  http://java.dzone.com/articles/intro-rest  http://architects.dzone.com/articles/putting-java-rest  Books  Coming this fall “RESTFul Java” by me  O’Reilly’s “RESTful Web Services”  http://oreilly.com/catalog/9780596529260/ Andrea Leoncini News from JBoss World
  • 28. Infinispan Andrea Leoncini News from JBoss World
  • 29. Cloud Computing  Clouds are happening  You cannot escape them! ;)  Traditional datacenters will be marginalized to niche deployments  Clouds become mainstream Andrea Leoncini News from JBoss World
  • 30. Why are clouds popular? ● Piecemeal cost ● Pay for what you use ● Massive, global data centers means high availability, instant backups ● Everyone benefits from economies of scale ● Ability to scale on demand ● Very fast provisioning ● Proven charging model ● Remember timesharing on mainframes? Andrea Leoncini News from JBoss World
  • 31. Data Storage ● Clouds are inherently stateless and ephemeral ● Databases on clouds don't make sense ● Traditional modes of data storage won't work ● Scalability is crucial ● Databases still are a bottleneck ● … and single point of failure! Andrea Leoncini News from JBoss World
  • 32. Trying to make databases work in the cloud ● Native database clustering ● Notoriously slow and non-scalable ● Unreliable ● Expensive! ● Need special hardware, e.g., SAN Andrea Leoncini News from JBoss World
  • 33. The solution: Data Grids! ● Data grids are perfect for clouds ● Highly scalable ● No single point of failure ● Works with ephemeral nodes ● Very low latency ● Data grids ● Amazon SimpleDB uses Dynamo ● Infinispan, etc. ● Many other commercial and open source offerings Andrea Leoncini News from JBoss World
  • 34. Introducing Infinispan ● Highly scalable data grid platform ● 100% open source licensed (LGPL) ● Based on some JBoss Cache code ● But mostly all-new! ● JBoss Cache is a clustered caching library ● Infinispan is a data grid platform ● JBoss Cache uses a tree-structured API ● Infinispan is a Map. Like JSR-107’s JCACHE Andrea Leoncini News from JBoss World
  • 35. Infinispan != JBoss Cache 4 ● Internal data container design completely different ● APIs completely different ● Not backward-compatible ● Although an code-level compatibility layer is available Andrea Leoncini News from JBoss World
  • 36. More scalable than JBoss Cache ● Internal structures more memory efficient ● Data organised in Map-like structures ● Making use of CAS ● minimising synchronized blocks, mutexes ● Containers are naturally ordered ● Makes eviction much more efficient ● Uses JBoss Marshalling ● Smaller payloads + poolable streams = faster remote calls Andrea Leoncini News from JBoss World
  • 37. “Borrowed” from JBoss Cache ● JTA transactions ● Replicated data structure ● Eviction, cache persistence ● Notifications and eventing API ● JMX reporting ● Fine-grained replication ● MVCC locking ● Non-blocking state transfer techniques ● Query API ● Custom (non-JDK) marshalling Andrea Leoncini News from JBoss World
  • 38. … and new features! ● Consistent hash based data distribution ● Much simpler Map API (JSR-107 compliant) ● JPA API ● Client/server module with memcached compatibility ● REST API ● Ability to be consumed by non-JVM platforms ● JOPR based GUI management console ● Distributed executors ● Map/reduce programming model made easy! Andrea Leoncini News from JBoss World
  • 39. Distributed Cache ● Consistent hash based data distribution ● Will allow us to scale to bigger clusters ● Goal of efficient scaling to 1000’s of nodes ● Lightweight, “L1” cache for efficient reads ● On writes, “L1” gets invalidated ● Dynamic rebalancing Andrea Leoncini News from JBoss World
  • 40. jboss.org/hornetq H  HornetQ is the new name for JBoss Messaging 2  HornetQ is an open source community project to build a multi-protocol asynchronous messaging system  HornetQ is designed for performance  HornetQ is designed with usability in mind  HornetQ is full featured  See the wiki for more information: http://www.jboss.org/community/wiki/HornetQGeneralFAQs Andrea Leoncini News from JBoss World
  • 41. How does HornetQ relate to JBoss Messaging?  We decided to rename JBoss Messaging 2 to HornetQ  JBM 1.x and 2.x code bases 95%+ different.  HornetQ is a different beast to JBM 1.x  HornetQ is not tightly coupled to JBoss Application Server Andrea Leoncini News from JBoss World
  • 42. Both standalone and JEE messaging  HornetQ is a fully functional stand-alone messaging server – if you don't want an app server, don't use an app server  HornetQ can also be integrated with any JEE application server, e.g. JBoss Application Server 5.0, using its JCA adaptor  HornetQ can also be used with any dependency injection framework, e.g. JBoss MC, Spring, Google Guice Andrea Leoncini News from JBoss World
  • 43. HornetQ features  Very high performance journal  Support for huge queues and huge messages with small server and client footprint  Pluggable transport system  Seamless High Availability (HA)  Massively flexible clustering  Extensive management API  Lots, lots, more, but no time here! See the wiki for a full list: http://www.jboss.org/community/wiki/HornetQFeatures Andrea Leoncini News from JBoss World
  • 44. Ultra high performance journal  HornetQ persistence is very fast  Very fast store using Linux asynchronous IO.  Up to 100+ MiB/s on a single node!  JNI interface to aio library (libaio), encapsulated in Java package.  Automatic switches to Java NIO when not running on Linux Andrea Leoncini News from JBoss World
  • 45. Huge queues and messages  HornetQ supports huge queues – far bigger than can fit in available RAM  Run Terabyte queues while the server is only running in 50MiB of RAM!  Send and receive huge multi-gigabyte messages with all the normal transactional semantics  Effectively, only limit to message size is available disk space. We have tested messages up to 8 GiB in size. Andrea Leoncini News from JBoss World
  • 46. Configurable Transport system  Fully pluggable transport  Ships with default implementation using JBoss Netty http://jboss.org/netty/  TCP transport  SSL transport  HTTP transport  Servlet transport  In-VM transport Andrea Leoncini News from JBoss World
  • 47. News from Grazie! andrea.leoncini@redhat.com