SlideShare a Scribd company logo
1 of 40
Download to read offline
1




       FLEX & JAVA USING
       BLAZEDS



Hien Luu   2009 Silicon Valley Code Camp
About Me
2


      Senior Software Engineer at Netflix
      Many years with developing web-based

       applications with Java technologies
      Instructor at UCSC-Extension school

           RIA with Flex & Java
           Spring Framework

           Design Patterns
Flex & Java Using BlazeDS
3


        Agenda
           BlazeDS   Overview
             What   & Why
           BlazeDS Tour
           BlazeDS Architecture
           BlazeDS Services
             Remoting
             Messaging
             Proxying
           Demo
Flex & Java Using BlazeDS
4




               Quick Survey
BlazeDS Overview
5


        Open source project from Adobe – 12/07
           Smaller   cousin of Adobe LifeCycle Data Services



                                   Servlet Container
                                       BlazeDS
                                                                Database
                                        Your
                                      Application
BlazeDS Overview
6


        Alternatives


                               Servlet Container

                                  Your Java        Database
                                  application


                                    PHP/Python




                    Granite, OpeAMF, Cinnamon,
AMF
7


        AMF (Action Message Format)
           Wire   protocol
             Fast,   small – 10x over XML
           AMF3      specification
        Open Source AMF Implementation
           AMFPHP

           OpenAMF

           rubyAMF

           PyAMF
BlazeDS Tour
8


        Download Turnkey version
           Include Tomcat 6.x
           BlazeDS sample applications

           Flex 3 SDK

        Unzip and start Tomcat and HSQL
           Come   with sample database – product and census data




                         http://localhost:8400/
BlazeDS Architecture
9

                           BlazeDS Services

    Access to enterprise
       functionality
                                 RPC Service


      Let Flex clients
     communicate with
        each other
                              Messaging Service
      asynchronously
                                                   Proxy service to
                                                  integrate multiple
                                                    services with a
                                Proxy Service     single application
BlazeDS Architecture
10


                           Flex Client Architecture

            Flex Client                               J2EE Server

     BlazeDS Component
                                                        BlazeDS
        RemoteObject
         HTTPService
         WebService
                                              HTTP
          Consumer
          Producer                        AMF/AMFX
                          Channel Set
                           M
                           A

                           F
                          H


                          P
                          T
                          T
BlazeDS Architecture
11

                                        BlazeDS Server Architecture

                              Message
     MessageBrokerServlet      Broker           Service          Destination           Adapter


     •  AMFEndPoint
                                 R         RemotingService      RemotingDestination
     • HTTPEndPoint              O
     • StreamingAMFEndPoint      U                                                    JavaAdapter
                                           HttpProxyService
                                 T                             HttpProxyDestination
                                 E
                                                                                       HttpProxy
                                           MessageService
                                                                                        Adapter
                                 M
                                 S                              MessageDestination

                                 G                                                    ActionScript
                                                                                       Adapter
                                                Security                                JMS
                                               Check point
                                                                                       Adapter
BlazeDS Configuration
12




     Filename              Description

     services-config.xml   Top level configuration file. Contains security constraints
                           definitions. Logging settings. Basically common configurations
                           across services.
     remoting-config.xml   Remoting service definitions, such as destination.


     proxy-config.xml      Proxy service definitions for working with web services, HTTP.


     remoting-config.xml   Messaging service for publish & subscribe
BlazeDS Channels & EndPoints
13


         Channel set fallback mechanism

          Channel                Endpoint                Description
          AMFChannel             AMFEndPoint             Transport data over HTTP in binary
                                                         AMF format. Use for Remoting.

          HTTPChannel            HTTPEndPoint            Transport data over HTTP in AMFX
                                                         format. User for Remoting.

          StreamingAMFChannel    StringAMFEndPoint       Streams data in real time over HTTP
                                                         in binary AMF format. User for
                                                         Messaging.
          StreamingHTTPChannel   StreamingHTTPEndPoint   Streams data over HTTP in AMFX
                                                         foramt.
BlazeDS Channels Behavior
14




     Channel                           Description
     Non-polling AMF & HTTP channel    Good for Remoting


     Piggybacking AMF & HTTP channel Enable queuing of messages along with responses to
                                     any messages from client.

     Polling AMF & HTTP channel        Simple polling mechanism from client side to request
                                       messages


     Long polling AMF & HTTP channel   To get pushed messages to client. Server parks the
                                       poll request until data arrives for client.

     Streaming channel                 Stream data in real-time. Available in HTTP 1.1 only.
                                       Make sure servers are capable of handling large
                                       concurrent connections
Remoting
15


       Invoke methods of Java objects on server side
       HTTP-based request/response data communication

       Use AMFChannel

       Advantages

            AMF   binary messaging protocol for exchanging data
            Serialization/de-serialization are handled automatically

            Natively supported by Flash Player

            Gateway services make easier to expose server side
             services
                           Why not use HTTPService or WebService?
Remoting
16


         RemoteObject – client side component
            destination– source of Remoting Service destination
            result – when service call successfully returns

            fault – when service call fails

            concurrency – how to handle multiple calls
              multiple – existing requests are not cancelled
              single – one at a time, multiple requests generate fault
              last – New request cancels any existing request
BlazeDS Architecture
17

                                      BlazeDS Server Architecture

                            Message
     MessageBrokerServlet    Broker          Service           Destination           Adapter


     •  AMFEndPoint
                               R         RemotingService      RemotingDestination
                               O
                               U                                                    JavaAdapter
                               T
                               E

                               M
                               S
                               G

                                              Security
                                             Check point
Remoting
18


     <mx:Script>
        private function getProducts() : void {
          ro.getProducts();
        }
        private function handleGetProdudctResult(event:ResultEvent) : void {
        }
        private function handleUpdateProdudctResult(event:ResultEvent) : void {
        }
        private function handleFault(event:FaultEvent) : void {
          Alert.show(event.fault.faultString);
        }
     </mx:Script>

     <mx:RemoteObject id="ro" destination="tutorial-product" showBusyCursor="true">
        <mx:method name="getProducts" fault="handleFault(event)"
             result="handleGetProductsResult(event)" />
        <mx:method name="updateProduct" fault="handleFault(event)"
             result="handleUpdateProductResult(event)" />
     </mx:RemoteObject>

     <mx:Button label=“Get Products” click=“getProduct()” />




                   http://localhost:8400/samples/blazeds-debug/Census.html
Remoting
19
                                remoting-config.xml
                    <destination id="tutorial-product">
                        <properties>
                            <source>tutorial.ProductDAO</source>
                        </properties>
                    </destination>


Java Class                                                                Java Class
package tutorial;                                 package tutorial;
public class ProductDAO {                         public class Product {
  public List<Product> getProducts() {              private int productId;
    // DB logic                                     private String name;
  }                                                 private double price;
                                                    private int qty;
     public void updateProduct(Product prod){
       // DB logic                                    // getters and setters for
     }                                                // above member variables
}                                                 }
Remoting
20


     <mx:Script>
        [Bindable]
         private var products:ArrayCollection
         private function handleGetProductsResult(event:ResultEvent) : void {
             products = event.result as ArrayCollection;
         }
         private function handleFault(event:FaultEvent) : void {
           Alert.show(event.toString());
         }
     </mx:Script>

     <mx:DataGrid dataProvider="{products}" width="100%" height="100%" id="dg" >
       <mx:columns>
         <mx:DataGridColumn headerText="Serial Number" dataField="productId" />
         <mx:DataGridColumn headerText="Name" dataField="name" />
         <mx:DataGridColumn headerText="Price" dataField="price" />
         <mx:DataGridColumn headerText="Quantity" dataField="qty" />
       </mx:columns>
     </mx:DataGrid>
Remoting
21


         Destination scope
            request  – server creates an instance of Java class per
             request (Default)
            application – one instance for entire application

            session - one instance per session




                       <destination id="tutorial-product">
                           <properties>
                               <source>tutorial.ProductDAO</source>
                               <scope>request</scope>
                           </properties>
                       </destination>
Remoting
22


         Concurrency
            multiple  – existing requests are not canceled
            Single – one at a time

            last – latest request cancels any existing request



     <mx:RemoteObject id="ro" destination="tutorial-product"
     showBusyCursor="true">
        <mx:method name="getProducts" fault="handleFault(event)"
             result="handleGetProductsResult(event)"
             concurrency=“multiple”/>
     </mx:RemoteObject>
Data Serialization
23




                          Servlet Container

             AS   Java
                               BlazeDS



             AS   Java      Your Application
Data Serialization
24


         Serializing Between ActionScript & Java
                        AS Type                                       Java
           Array(dense)                              java.util.List
           Array(sparse)                             java.util.Map
           Boolean                                   java.lang.Boolean
           Date                                      java.util.Date
           int/uint                                  java.lang.Integer
           Object                                    java.util.Map
           Typed Object                              Typed Object [RemoteClass]
           XML                                       org.w3c.dom.Document

            • Dense array – all numeric indexes are consecutive (no gap)
            • Sparse – gap between numeric indexes
Remoting
25


         AS Serialization Rule
            Public bean properties w/ getter/setter methods
            Public variables
            Private properties, constants are not serialized
         Client side
            Use   [RemoteClass(alias=“ “)] to map directly to Java object
         Custom Serialization
                                            package {
            Iexternallizable   interface     [Bindable]
                                              [RemoteClass(alias="tutorial.Product")]
         [Transient]                         public class Product {
                                                public var productId:int;
                                                public var name:String;
                                                public var price:Number;
                                                public var qty:int;
                                              }
                                            }
Remoting
26




                                       java.util.ArrayList

     ActionScript                                                    ActionScript
        Array                           java.util.TreeSet
                                                                    ArrayCollection

                                        java.util.TreeSet


              public class ProductService {
                 public void addProduct(java.util.Set products) {}

                    public void addProduct(java.util.SortedSet products) {}

                    public void addProduct(java.util.List products) {}
              }
Messaging
27


         Publish-subscribe messaging
            Among  multiple Flex clients
            Support bridging to JMS topics (only)

            Server can push message to client on its own.
                                                      Consumer

     Message
     Producer

                              Messaging                Consumer
                               Service
Messaging
28

                                      BlazeDS Server Architecture

                            Message
     MessageBrokerServlet    Broker          Service           Destination          Adapter


                               R         MessageService       MessageDestination
     •  Producer
                               O
     • Consumer                U                                                   ActionScript
                                                                                    Adapter
                               T
                               E
                                                                                      JMS
                               M                                                     Adapter
                               S
                               G                                                      Custom
                                                                                      Adapter
Messaging
29
                             messaging-config.xml
                 <destination id=’chat’>
                     <channels>
                         <channel ref=‘sample-amf’>
                     </channels>
                 </destination>


<mx:Application>
  <mx:Script>
     private function sendMessage(): void {
       var msg = new AsyncMesage();
       msg.body = “Hello there”
       producer.send(msg);
     }
     private function handler(event:MessageEvent) : void {
       Alert.show(“Got it: “ + event.message.body;
     }
  </mx:Script>
  <mx:Producer id=“producer” destination=“chat”>
  <mx:Consumer id=“consumer” destination=“chat”
    message=“handler(event)”>
</mx:Application>
Messaging
30


         Message filtering
            Through message header and subtopic information
            Subscriber defines the filter criteria
              Send   to server during the subscripting step
            Message    filtering is done on the server
<mx:Application>
  <mx:Script>
     private function sendMessage(): void {    <mx:Application>
       var msg = new AsyncMesage();              <mx:Script>
       msg.headers = new Array();                  …
       msg.headers[“user”]= “John”;              </mx:script>
       msg.body = “Hello there”;                 <mx:Consumer id=“consumer”
       producer.send(msg);                         destination=“chat”
     }                                             message=“handler(event)”
  </mx:script>                                     selector=“user = ‘John’”>
  …                                            </mx:Application>
</mx:Application>
Messaging
31



           Filtering through subtopic
              Usesubtopic property of AsyncMessage
              Support single-token wildcard in subtopic string
     <mx:Application>
       <mx:Script>
          private function sendMessage(): void {
             var msg = new AsyncMesage();
             msg.body = “Hello there”;
             producer.subtopic = “chat.gossip”;
             producer.send(msg);                   <mx:Application>
          }                                          <mx:Script>
       </mx:script>                                    …
       <mx:Producer id=“producer”                    </mx:script>
            destination=“chat”>                      <mx:Consumer id=“consumer”
       …                                               destination=“chat”
     </mx:Application>                                 message=“handler(event)”
                                                       subtopic=“chat.gossip”>
                                                   </mx:Application>
Messaging
32




               Enable destination to support subtopic

     <destination id=“chat” >
         <properties>
            <server>
               <allow-subtopics>true</allow-subtopics>
               <subtopic-separator>.</subtopic-separator>
         </properties>
         <channels>
              <channel ref=‘sample-amf’>
          </channels>
      </destination>
Messaging
33




                            Performance related settings

     Property                       Description
     throttle-inbound               Control # of inbound messages per second
     throttle-outbound              Control # of outbound messages per second
     message-time-to-live           How long server should keep a message pending
                                    delivery before being discarded as undeliverable



                                Additional settings for security
Messaging
34


         Measuring message processing performance
            Message  size
            Sever processing time

            Network travel time

            Message waiting time

       Ensure clients & server clocks are synchronized
       Enable at the channel level
Messaging
35


     <channel-definition id="my-streaming-amf”
         class="mx.messaging.channels.StreamingAMFChannel">
      <endpoint
        url="http://{server.name}:{server.port}/{context.root}/
        messagebroker/streamingamf”
        class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
      <properties>
        <record-message-times>true</record-message-times>
        <record-message-sizes>true</record-message-sizes>
      </properties>
     </channel-definition>
Messaging
36


             Use MessagePerformanceUtils to access processing
              metrics


     private function messageHandler(message:IMessage):void {
       log.text += message.headers["user"] + ": " +
       message.body.chatMessage + "n";

         var perfInfo:MessagePerformanceUtils = new
         MessagePerformanceUtils(message);
         Alert.show(perfInfo.prettyPrint());

     }
Proxy
37

                                 google.com




             Servlet Container
                 BlazeDS          yahoo.com

                  Your
                Application



                                 amazon.com
Proxy
38


           HTTPService
              REST  functionality
              All HTTP method
                PUT,   DELETE, HEAD, POST, GET
              Get response data when status code != 200
              URL alias control on server side


     <mx:HTTPService destination="CNNFeed" useProxy="true" id="topNewService"
        resultFormat="e4x” result="handleTopNewResult(event)"/>

     <!– using default proxy destination 
     <mx:HTTPService useProxy="true" id="searchService" resultFormat="e4x”
        result="handleSearchResult(event)” />
Proxy
39


         Proxy-config.xml
            Server   side configuration

     <destination id="DefaultHTTP">
       <properties>
         <dynamic-url>http://*</dynamic-url>
       </properties>
     </destination>

     <destination id="CNNFeed">
        <properties>
         <url>http://rss.cnn.com/rss/cnn_topstories.rss</url>
        </properties>
     </destination>
Resources
40


         BlazeDS
              http://opensource.adobe.com/wiki/display/blazeds/Overview
         AMF Benchmark
              http://www.jamesward.com/census
         Architecting RIAs with Flex Data Management Services
              http://www.adobe.com/devnet/flex/articles/architecting_rias.html

More Related Content

What's hot

Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCFybbest
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integrationrssharma
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integrationravinxg
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCFBarry Dorrans
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Peter R. Egli
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewJorgen Thelin
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487Bat Programmer
 
REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5Rob Windsor
 
Biz talk summit 2013 - The new cloud related adapters
Biz talk summit 2013 - The new cloud related adaptersBiz talk summit 2013 - The new cloud related adapters
Biz talk summit 2013 - The new cloud related adaptersBizTalk360
 
Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Saltmarch Media
 
Introduction to web services and how to in php
Introduction to web services and how to in phpIntroduction to web services and how to in php
Introduction to web services and how to in phpAmit Kumar Singh
 
Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012telestax
 

What's hot (20)

Introduction to WCF
Introduction to WCFIntroduction to WCF
Introduction to WCF
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
 
BlazeDS
BlazeDSBlazeDS
BlazeDS
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
 
10 Tricks and Tips for WCF
10 Tricks and Tips for WCF10 Tricks and Tips for WCF
10 Tricks and Tips for WCF
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
WCF
WCFWCF
WCF
 
WCF
WCFWCF
WCF
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
 
REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5
 
Biz talk summit 2013 - The new cloud related adapters
Biz talk summit 2013 - The new cloud related adaptersBiz talk summit 2013 - The new cloud related adapters
Biz talk summit 2013 - The new cloud related adapters
 
Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0Building RESTful Services with WCF 4.0
Building RESTful Services with WCF 4.0
 
Introduction to web services and how to in php
Introduction to web services and how to in phpIntroduction to web services and how to in php
Introduction to web services and how to in php
 
Lecture 3 soap
Lecture 3 soapLecture 3 soap
Lecture 3 soap
 
Cfalfresco
CfalfrescoCfalfresco
Cfalfresco
 
Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012
 
Webservices
WebservicesWebservices
Webservices
 

Similar to Flex & Java BlazeDS Remoting Overview

Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)Christopher Grant
 
BlazeDS
BlazeDS BlazeDS
BlazeDS Priyank
 
RIAs with Java, Spring, Hibernate, BlazeDS, and Flex
RIAs with Java, Spring, Hibernate, BlazeDS, and FlexRIAs with Java, Spring, Hibernate, BlazeDS, and Flex
RIAs with Java, Spring, Hibernate, BlazeDS, and Flexelliando dias
 
Sap xi online training
Sap xi online trainingSap xi online training
Sap xi online trainingVenkat reddy
 
Flex Messeging Services
Flex Messeging ServicesFlex Messeging Services
Flex Messeging Servicesravinxg
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party ToolsBIOVIA
 
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad IrzanIndonesia Network Operators Group
 
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL RoutingBIOVIA
 
Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011Bram de Kruijff
 
Understanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIsUnderstanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIsKenneth Peeples
 
Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...
Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...
Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...Videoguy
 
Mike Taulty TechDays 2010 Silverlight 4 - What's New?
Mike Taulty TechDays 2010 Silverlight 4 - What's New?Mike Taulty TechDays 2010 Silverlight 4 - What's New?
Mike Taulty TechDays 2010 Silverlight 4 - What's New?ukdpe
 
Oop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXFOop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXFAdrian Trenaman
 
REST APIs and MQ
REST APIs and MQREST APIs and MQ
REST APIs and MQMatt Leming
 

Similar to Flex & Java BlazeDS Remoting Overview (20)

Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)
 
BlazeDS
BlazeDS BlazeDS
BlazeDS
 
RIAs with Java, Spring, Hibernate, BlazeDS, and Flex
RIAs with Java, Spring, Hibernate, BlazeDS, and FlexRIAs with Java, Spring, Hibernate, BlazeDS, and Flex
RIAs with Java, Spring, Hibernate, BlazeDS, and Flex
 
Sap xi online training
Sap xi online trainingSap xi online training
Sap xi online training
 
Flex Messeging Services
Flex Messeging ServicesFlex Messeging Services
Flex Messeging Services
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
 
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
09 (IDNOG02) Services SDN & NFV Delivering more with less by Mochammad Irzan
 
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
 
Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011Amdatu - ApacheCon NA 2011
Amdatu - ApacheCon NA 2011
 
Riding with camel
Riding with camelRiding with camel
Riding with camel
 
ppt
pptppt
ppt
 
ppt
pptppt
ppt
 
Understanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIsUnderstanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIs
 
Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...
Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...
Remarks on Grids e-Science CyberInfrastructure and Peer-to-Peer ...
 
Mike Taulty TechDays 2010 Silverlight 4 - What's New?
Mike Taulty TechDays 2010 Silverlight 4 - What's New?Mike Taulty TechDays 2010 Silverlight 4 - What's New?
Mike Taulty TechDays 2010 Silverlight 4 - What's New?
 
Blaze Ds Slides
Blaze Ds SlidesBlaze Ds Slides
Blaze Ds Slides
 
Oop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXFOop2008 RESTful services with GWT and Apache CXF
Oop2008 RESTful services with GWT and Apache CXF
 
Websphere - overview and introduction
Websphere - overview and introduction Websphere - overview and introduction
Websphere - overview and introduction
 
REST APIs and MQ
REST APIs and MQREST APIs and MQ
REST APIs and MQ
 

Recently uploaded

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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...Drew Madelung
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Flex & Java BlazeDS Remoting Overview

  • 1. 1 FLEX & JAVA USING BLAZEDS Hien Luu 2009 Silicon Valley Code Camp
  • 2. About Me 2   Senior Software Engineer at Netflix   Many years with developing web-based applications with Java technologies   Instructor at UCSC-Extension school   RIA with Flex & Java   Spring Framework   Design Patterns
  • 3. Flex & Java Using BlazeDS 3   Agenda   BlazeDS Overview   What & Why   BlazeDS Tour   BlazeDS Architecture   BlazeDS Services   Remoting   Messaging   Proxying   Demo
  • 4. Flex & Java Using BlazeDS 4 Quick Survey
  • 5. BlazeDS Overview 5   Open source project from Adobe – 12/07   Smaller cousin of Adobe LifeCycle Data Services Servlet Container BlazeDS Database Your Application
  • 6. BlazeDS Overview 6   Alternatives Servlet Container Your Java Database application PHP/Python Granite, OpeAMF, Cinnamon,
  • 7. AMF 7   AMF (Action Message Format)   Wire protocol   Fast, small – 10x over XML   AMF3 specification   Open Source AMF Implementation   AMFPHP   OpenAMF   rubyAMF   PyAMF
  • 8. BlazeDS Tour 8   Download Turnkey version   Include Tomcat 6.x   BlazeDS sample applications   Flex 3 SDK   Unzip and start Tomcat and HSQL   Come with sample database – product and census data http://localhost:8400/
  • 9. BlazeDS Architecture 9 BlazeDS Services Access to enterprise functionality RPC Service Let Flex clients communicate with each other Messaging Service asynchronously Proxy service to integrate multiple services with a Proxy Service single application
  • 10. BlazeDS Architecture 10 Flex Client Architecture Flex Client J2EE Server BlazeDS Component BlazeDS RemoteObject HTTPService WebService HTTP Consumer Producer AMF/AMFX Channel Set M A F H P T T
  • 11. BlazeDS Architecture 11 BlazeDS Server Architecture Message MessageBrokerServlet Broker Service Destination Adapter •  AMFEndPoint R RemotingService RemotingDestination • HTTPEndPoint O • StreamingAMFEndPoint U JavaAdapter HttpProxyService T HttpProxyDestination E HttpProxy MessageService Adapter M S MessageDestination G ActionScript Adapter Security JMS Check point Adapter
  • 12. BlazeDS Configuration 12 Filename Description services-config.xml Top level configuration file. Contains security constraints definitions. Logging settings. Basically common configurations across services. remoting-config.xml Remoting service definitions, such as destination. proxy-config.xml Proxy service definitions for working with web services, HTTP. remoting-config.xml Messaging service for publish & subscribe
  • 13. BlazeDS Channels & EndPoints 13   Channel set fallback mechanism Channel Endpoint Description AMFChannel AMFEndPoint Transport data over HTTP in binary AMF format. Use for Remoting. HTTPChannel HTTPEndPoint Transport data over HTTP in AMFX format. User for Remoting. StreamingAMFChannel StringAMFEndPoint Streams data in real time over HTTP in binary AMF format. User for Messaging. StreamingHTTPChannel StreamingHTTPEndPoint Streams data over HTTP in AMFX foramt.
  • 14. BlazeDS Channels Behavior 14 Channel Description Non-polling AMF & HTTP channel Good for Remoting Piggybacking AMF & HTTP channel Enable queuing of messages along with responses to any messages from client. Polling AMF & HTTP channel Simple polling mechanism from client side to request messages Long polling AMF & HTTP channel To get pushed messages to client. Server parks the poll request until data arrives for client. Streaming channel Stream data in real-time. Available in HTTP 1.1 only. Make sure servers are capable of handling large concurrent connections
  • 15. Remoting 15   Invoke methods of Java objects on server side   HTTP-based request/response data communication   Use AMFChannel   Advantages   AMF binary messaging protocol for exchanging data   Serialization/de-serialization are handled automatically   Natively supported by Flash Player   Gateway services make easier to expose server side services Why not use HTTPService or WebService?
  • 16. Remoting 16   RemoteObject – client side component   destination– source of Remoting Service destination   result – when service call successfully returns   fault – when service call fails   concurrency – how to handle multiple calls   multiple – existing requests are not cancelled   single – one at a time, multiple requests generate fault   last – New request cancels any existing request
  • 17. BlazeDS Architecture 17 BlazeDS Server Architecture Message MessageBrokerServlet Broker Service Destination Adapter •  AMFEndPoint R RemotingService RemotingDestination O U JavaAdapter T E M S G Security Check point
  • 18. Remoting 18 <mx:Script> private function getProducts() : void { ro.getProducts(); } private function handleGetProdudctResult(event:ResultEvent) : void { } private function handleUpdateProdudctResult(event:ResultEvent) : void { } private function handleFault(event:FaultEvent) : void { Alert.show(event.fault.faultString); } </mx:Script> <mx:RemoteObject id="ro" destination="tutorial-product" showBusyCursor="true"> <mx:method name="getProducts" fault="handleFault(event)" result="handleGetProductsResult(event)" /> <mx:method name="updateProduct" fault="handleFault(event)" result="handleUpdateProductResult(event)" /> </mx:RemoteObject> <mx:Button label=“Get Products” click=“getProduct()” /> http://localhost:8400/samples/blazeds-debug/Census.html
  • 19. Remoting 19 remoting-config.xml <destination id="tutorial-product"> <properties> <source>tutorial.ProductDAO</source> </properties> </destination> Java Class Java Class package tutorial; package tutorial; public class ProductDAO { public class Product { public List<Product> getProducts() { private int productId; // DB logic private String name; } private double price; private int qty; public void updateProduct(Product prod){ // DB logic // getters and setters for } // above member variables } }
  • 20. Remoting 20 <mx:Script> [Bindable] private var products:ArrayCollection private function handleGetProductsResult(event:ResultEvent) : void { products = event.result as ArrayCollection; } private function handleFault(event:FaultEvent) : void { Alert.show(event.toString()); } </mx:Script> <mx:DataGrid dataProvider="{products}" width="100%" height="100%" id="dg" > <mx:columns> <mx:DataGridColumn headerText="Serial Number" dataField="productId" /> <mx:DataGridColumn headerText="Name" dataField="name" /> <mx:DataGridColumn headerText="Price" dataField="price" /> <mx:DataGridColumn headerText="Quantity" dataField="qty" /> </mx:columns> </mx:DataGrid>
  • 21. Remoting 21   Destination scope   request – server creates an instance of Java class per request (Default)   application – one instance for entire application   session - one instance per session <destination id="tutorial-product"> <properties> <source>tutorial.ProductDAO</source> <scope>request</scope> </properties> </destination>
  • 22. Remoting 22   Concurrency   multiple – existing requests are not canceled   Single – one at a time   last – latest request cancels any existing request <mx:RemoteObject id="ro" destination="tutorial-product" showBusyCursor="true"> <mx:method name="getProducts" fault="handleFault(event)" result="handleGetProductsResult(event)" concurrency=“multiple”/> </mx:RemoteObject>
  • 23. Data Serialization 23 Servlet Container AS Java BlazeDS AS Java Your Application
  • 24. Data Serialization 24   Serializing Between ActionScript & Java AS Type Java Array(dense) java.util.List Array(sparse) java.util.Map Boolean java.lang.Boolean Date java.util.Date int/uint java.lang.Integer Object java.util.Map Typed Object Typed Object [RemoteClass] XML org.w3c.dom.Document • Dense array – all numeric indexes are consecutive (no gap) • Sparse – gap between numeric indexes
  • 25. Remoting 25   AS Serialization Rule   Public bean properties w/ getter/setter methods   Public variables   Private properties, constants are not serialized   Client side   Use [RemoteClass(alias=“ “)] to map directly to Java object   Custom Serialization package {   Iexternallizable interface [Bindable] [RemoteClass(alias="tutorial.Product")]   [Transient] public class Product { public var productId:int; public var name:String; public var price:Number; public var qty:int; } }
  • 26. Remoting 26 java.util.ArrayList ActionScript ActionScript Array java.util.TreeSet ArrayCollection java.util.TreeSet public class ProductService { public void addProduct(java.util.Set products) {} public void addProduct(java.util.SortedSet products) {} public void addProduct(java.util.List products) {} }
  • 27. Messaging 27   Publish-subscribe messaging   Among multiple Flex clients   Support bridging to JMS topics (only)   Server can push message to client on its own. Consumer Message Producer Messaging Consumer Service
  • 28. Messaging 28 BlazeDS Server Architecture Message MessageBrokerServlet Broker Service Destination Adapter R MessageService MessageDestination •  Producer O • Consumer U ActionScript Adapter T E JMS M Adapter S G Custom Adapter
  • 29. Messaging 29 messaging-config.xml <destination id=’chat’> <channels> <channel ref=‘sample-amf’> </channels> </destination> <mx:Application> <mx:Script> private function sendMessage(): void { var msg = new AsyncMesage(); msg.body = “Hello there” producer.send(msg); } private function handler(event:MessageEvent) : void { Alert.show(“Got it: “ + event.message.body; } </mx:Script> <mx:Producer id=“producer” destination=“chat”> <mx:Consumer id=“consumer” destination=“chat” message=“handler(event)”> </mx:Application>
  • 30. Messaging 30   Message filtering   Through message header and subtopic information   Subscriber defines the filter criteria   Send to server during the subscripting step   Message filtering is done on the server <mx:Application> <mx:Script> private function sendMessage(): void { <mx:Application> var msg = new AsyncMesage(); <mx:Script> msg.headers = new Array(); … msg.headers[“user”]= “John”; </mx:script> msg.body = “Hello there”; <mx:Consumer id=“consumer” producer.send(msg); destination=“chat” } message=“handler(event)” </mx:script> selector=“user = ‘John’”> … </mx:Application> </mx:Application>
  • 31. Messaging 31   Filtering through subtopic   Usesubtopic property of AsyncMessage   Support single-token wildcard in subtopic string <mx:Application> <mx:Script> private function sendMessage(): void { var msg = new AsyncMesage(); msg.body = “Hello there”; producer.subtopic = “chat.gossip”; producer.send(msg); <mx:Application> } <mx:Script> </mx:script> … <mx:Producer id=“producer” </mx:script> destination=“chat”> <mx:Consumer id=“consumer” … destination=“chat” </mx:Application> message=“handler(event)” subtopic=“chat.gossip”> </mx:Application>
  • 32. Messaging 32 Enable destination to support subtopic <destination id=“chat” > <properties> <server> <allow-subtopics>true</allow-subtopics> <subtopic-separator>.</subtopic-separator> </properties> <channels> <channel ref=‘sample-amf’> </channels> </destination>
  • 33. Messaging 33 Performance related settings Property Description throttle-inbound Control # of inbound messages per second throttle-outbound Control # of outbound messages per second message-time-to-live How long server should keep a message pending delivery before being discarded as undeliverable Additional settings for security
  • 34. Messaging 34   Measuring message processing performance   Message size   Sever processing time   Network travel time   Message waiting time   Ensure clients & server clocks are synchronized   Enable at the channel level
  • 35. Messaging 35 <channel-definition id="my-streaming-amf” class="mx.messaging.channels.StreamingAMFChannel"> <endpoint url="http://{server.name}:{server.port}/{context.root}/ messagebroker/streamingamf” class="flex.messaging.endpoints.StreamingAMFEndpoint"/> <properties> <record-message-times>true</record-message-times> <record-message-sizes>true</record-message-sizes> </properties> </channel-definition>
  • 36. Messaging 36   Use MessagePerformanceUtils to access processing metrics private function messageHandler(message:IMessage):void { log.text += message.headers["user"] + ": " + message.body.chatMessage + "n"; var perfInfo:MessagePerformanceUtils = new MessagePerformanceUtils(message); Alert.show(perfInfo.prettyPrint()); }
  • 37. Proxy 37 google.com Servlet Container BlazeDS yahoo.com Your Application amazon.com
  • 38. Proxy 38   HTTPService   REST functionality   All HTTP method   PUT, DELETE, HEAD, POST, GET   Get response data when status code != 200   URL alias control on server side <mx:HTTPService destination="CNNFeed" useProxy="true" id="topNewService" resultFormat="e4x” result="handleTopNewResult(event)"/> <!– using default proxy destination  <mx:HTTPService useProxy="true" id="searchService" resultFormat="e4x” result="handleSearchResult(event)” />
  • 39. Proxy 39   Proxy-config.xml   Server side configuration <destination id="DefaultHTTP"> <properties> <dynamic-url>http://*</dynamic-url> </properties> </destination> <destination id="CNNFeed"> <properties> <url>http://rss.cnn.com/rss/cnn_topstories.rss</url> </properties> </destination>
  • 40. Resources 40   BlazeDS   http://opensource.adobe.com/wiki/display/blazeds/Overview   AMF Benchmark   http://www.jamesward.com/census   Architecting RIAs with Flex Data Management Services   http://www.adobe.com/devnet/flex/articles/architecting_rias.html