SlideShare a Scribd company logo
Flex Messeging Services Using BlazeDS Adobe Meet Oct 2009
What is BlazeDS? BlazeDS is a server-based Java remoting and web messaging technology that allows you to connect to back-end distributed data and push data in real-time to Adobe Flex and Adobe AIR Rich Internet applications (RIA).
Services of BlazeDS The Remoting Service allows your Flex application to directly invoke methods of Java objects deployed in your application server.  The Message Service provides a publish/subscribe infrastructure that allows your Flex application to publish messages and subscribe to a messaging destination, enabling the development of real-time data push and collaborative applications.  The Proxy Service allows your Flex application to make cross-domain service requests in a secure and controlled manner. It allows your Flex application to access a service available on a different domain than the domain from where the application was downloaded (without having to deploy a crossdomain.xml policy file on the target domain).
Feature of BlazeDS.
BlazeDS client architecture
BlazeDS server architecture
BlazeDS Message Channels BlazeDS Message Service is a simple publisher-subscriber model. The service configuration could be boiled down to two parts: channels and destinations. In networking terms, destination is the message hub and channel is the transport protocol.
Messaging Flex component Producer:You use the Producer component in a Flex application to enable the application to send messages. You can create Producer components in MXML or ActionScript. Consumer:You can create Consumer components in MXML or ActionScript. To subscribe to a destination, you call the Consumer.subscribe() method.
Simple Polling Polling is the fool-proof messaging protocol that’s guaranteed to work in most scenarios, but it’s also the slowest and least efficient.  The default messaging protocol in BlazeDS uses the simple polling technique.  The client pings the server on a regular interval. An empty acknowledgment is returned if there’re no messages for the client,
Simple Polling
Long Polling To achieve near-real-time messaging, there’s a option called “long polling”.  Instead of acknowledging right away, the server could hold the polling request until there’s a message for the client.  This ensure the messages are delivered to the client as soon as they become available,
Long Polling
Configure Long Polling To add a long polling channel to BlazeDS, open WEB-INF/flex/services-config.xml. Under the channels node, add the channel definition as follows,  <channel-definition id="my-long-polling-amf" class="mx.messaging.channels.AMFChannel"> 	<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling"; class="flex.messaging.endpoints.AMFEndpoint"/> 		<properties> 			<polling-enabled>true</polling-enabled> 			<wait-interval-millis>-1</wait-interval-millis> 			<polling-interval-millis>100</polling-interval-millis> 			<max-waiting-poll-requests>50</max-waiting-poll-requests> 		</properties> 	</channel-definition>
Polling Properties wait-interval-millis dictates how long the server should wait before returning a polling request. polling-interval-millis is the time interval between polling requests.  max-waiting-poll-requests caps the number of long polling clients. Since the server is not ackowleging right away during long polling, each client hogs one server thread.
Streaming BlazeDS supports real-time message streaming over AMF and HTTP. Unlike long polling, which closes and reopens the connection upon receiving a message, streaming keep the connection open at all times. <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> 	<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfstreaming"; class="flex.messaging.endpoints.StreamingAMFEndpoint"/> 		<properties> 			<idle-timeout-minutes>0</idle-timeout-minutes> 			<max-streaming-clients>10</max-streaming-clients> 			<server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis> 		</properties> </channel-definition>
Properties max-streaming-clientscontrols the number of concurrent streaming connections on the server. Streaming suffers from the same thread blocking issue as long polling. A cap must be set so the server is not hang by idle threads.  idle-time-minutes boots off long idling clients to free up threads. This could help alleviate the threading issue and help prevent misuse.
Which Channel to Use? With the slew of channel types available, which one should you choose?  Fortunately, you could leave that decision to the run-time environment.  The Flex client could be configured with a set of channels types.  It will go through the list one at a time until a successful connection could be made.
Clerification One last thing I need to clear up is the terminology confusion over the AMF channels and HTTP channels. In the context of BlazeDS channels, AMF refers to binary RPC protocol. HTTP refers to XML RPC protocol. They BOTH run on top of HTTP.
Demo
Q & A

More Related Content

What's hot

PMTA Success Story - J2 Martech
PMTA Success Story - J2 MartechPMTA Success Story - J2 Martech
PMTA Success Story - J2 Martech
SparkPost
 
Web technology
Web technologyWeb technology
Web technology
Anuj Singh Rajput
 
STUN protocol
STUN protocolSTUN protocol
STUN protocol
Giacomo Vacca
 
Mule execution
Mule executionMule execution
Mule execution
D.Rajesh Kumar
 
New features in PMTA 5.0
New features in PMTA 5.0New features in PMTA 5.0
New features in PMTA 5.0
SparkPost
 
10135 b 04
10135 b 0410135 b 04
10135 b 04
Wichien Saisorn
 
Soap service
Soap serviceSoap service
Soap service
Prabhat gangwar
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Jeremiah Grossman
 
Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012
telestax
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
sathishmca143
 
Proxy servers
Proxy serversProxy servers
Proxy servers
Kumar
 
Soap xp-wg
Soap xp-wgSoap xp-wg
Soap xp-wg
Safwan Hashmi
 
Mule execution
Mule executionMule execution
Mule execution
Praneethchampion
 
Web Real-time Communications
Web Real-time CommunicationsWeb Real-time Communications
Web Real-time Communications
Alexei Skachykhin
 
WWW for Mobile Apps
WWW for Mobile AppsWWW for Mobile Apps
WWW for Mobile Apps
Reni Sagayaraj
 
Reverse proxy
Reverse proxyReverse proxy
Reverse proxy
tim4911
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
Denis Ristic
 
Comet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsComet / WebSocket Web Applications
Comet / WebSocket Web Applications
Codemotion
 
SignalR
SignalRSignalR
SignalR
Eyal Vardi
 
RestComm Architecture Design
RestComm Architecture DesignRestComm Architecture Design
RestComm Architecture Design
telestax
 

What's hot (20)

PMTA Success Story - J2 Martech
PMTA Success Story - J2 MartechPMTA Success Story - J2 Martech
PMTA Success Story - J2 Martech
 
Web technology
Web technologyWeb technology
Web technology
 
STUN protocol
STUN protocolSTUN protocol
STUN protocol
 
Mule execution
Mule executionMule execution
Mule execution
 
New features in PMTA 5.0
New features in PMTA 5.0New features in PMTA 5.0
New features in PMTA 5.0
 
10135 b 04
10135 b 0410135 b 04
10135 b 04
 
Soap service
Soap serviceSoap service
Soap service
 
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
 
Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012Mobicents Telscale and RestComm - FOSDEM 2012
Mobicents Telscale and RestComm - FOSDEM 2012
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
 
Proxy servers
Proxy serversProxy servers
Proxy servers
 
Soap xp-wg
Soap xp-wgSoap xp-wg
Soap xp-wg
 
Mule execution
Mule executionMule execution
Mule execution
 
Web Real-time Communications
Web Real-time CommunicationsWeb Real-time Communications
Web Real-time Communications
 
WWW for Mobile Apps
WWW for Mobile AppsWWW for Mobile Apps
WWW for Mobile Apps
 
Reverse proxy
Reverse proxyReverse proxy
Reverse proxy
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
 
Comet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsComet / WebSocket Web Applications
Comet / WebSocket Web Applications
 
SignalR
SignalRSignalR
SignalR
 
RestComm Architecture Design
RestComm Architecture DesignRestComm Architecture Design
RestComm Architecture Design
 

Viewers also liked

Social Media - Qwest Story
Social Media - Qwest StorySocial Media - Qwest Story
Social Media - Qwest Story
Crazy Penguin Media
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
ravinxg
 
Richard´S Success
Richard´S SuccessRichard´S Success
Richard´S Success
Excale
 
AvisMap GIS Products Overview
AvisMap GIS Products OverviewAvisMap GIS Products Overview
AvisMap GIS Products Overview
avismapsoftware
 
J Query
J QueryJ Query
J Query
ravinxg
 
Satish prasad bangalore india_satmd410
Satish prasad bangalore india_satmd410Satish prasad bangalore india_satmd410
Satish prasad bangalore india_satmd410
satmd410
 
Mdd Lcds
Mdd LcdsMdd Lcds
Mdd Lcds
ravinxg
 

Viewers also liked (9)

Social Media - Qwest Story
Social Media - Qwest StorySocial Media - Qwest Story
Social Media - Qwest Story
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
 
146
146146
146
 
Richard´S Success
Richard´S SuccessRichard´S Success
Richard´S Success
 
AvisMap GIS Products Overview
AvisMap GIS Products OverviewAvisMap GIS Products Overview
AvisMap GIS Products Overview
 
J Query
J QueryJ Query
J Query
 
146
146146
146
 
Satish prasad bangalore india_satmd410
Satish prasad bangalore india_satmd410Satish prasad bangalore india_satmd410
Satish prasad bangalore india_satmd410
 
Mdd Lcds
Mdd LcdsMdd Lcds
Mdd Lcds
 

Similar to Flex Messeging Services

BlazeDS
BlazeDS BlazeDS
BlazeDS
Priyank
 
Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)
Christopher Grant
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
rssharma
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
Jignesh Aakoliya
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
Neil Ghosh
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
Nitish Nagar
 
Funambol Server Architecture
Funambol Server ArchitectureFunambol Server Architecture
Funambol Server Architecture
Funambol
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
Bat Programmer
 
Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
Subodh Pushpak
 
Introduction to WAP
Introduction to WAPIntroduction to WAP
Introduction to WAP
Nitin Saswade
 
SMS tracking API.pptx
SMS tracking API.pptxSMS tracking API.pptx
SMS tracking API.pptx
Atishay Chaudhary
 
Unit 5 Application Layer
Unit 5 Application LayerUnit 5 Application Layer
Unit 5 Application Layer
KalpanaC14
 
Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance Checklist
Salim M Bhonhariya
 
How a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdfHow a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdf
arccreation001
 
RIA With Flex & Java Using BlazeDS
RIA With Flex & Java Using BlazeDSRIA With Flex & Java Using BlazeDS
RIA With Flex & Java Using BlazeDS
Hien Luu
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
Yoss Cohen
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
Mindfire Solutions
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
Hoàng Hải Nguyễn
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
VijayapriyaP1
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
Mousmi Pawar
 

Similar to Flex Messeging Services (20)

BlazeDS
BlazeDS BlazeDS
BlazeDS
 
Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)Flex Remoting and Messaging (2010)
Flex Remoting and Messaging (2010)
 
Flex And Java Integration
Flex And Java IntegrationFlex And Java Integration
Flex And Java Integration
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
 
Funambol Server Architecture
Funambol Server ArchitectureFunambol Server Architecture
Funambol Server Architecture
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
 
Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
 
Introduction to WAP
Introduction to WAPIntroduction to WAP
Introduction to WAP
 
SMS tracking API.pptx
SMS tracking API.pptxSMS tracking API.pptx
SMS tracking API.pptx
 
Unit 5 Application Layer
Unit 5 Application LayerUnit 5 Application Layer
Unit 5 Application Layer
 
Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance Checklist
 
How a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdfHow a network connection is created A network connection is initi.pdf
How a network connection is created A network connection is initi.pdf
 
RIA With Flex & Java Using BlazeDS
RIA With Flex & Java Using BlazeDSRIA With Flex & Java Using BlazeDS
RIA With Flex & Java Using BlazeDS
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
 

Flex Messeging Services

  • 1. Flex Messeging Services Using BlazeDS Adobe Meet Oct 2009
  • 2. What is BlazeDS? BlazeDS is a server-based Java remoting and web messaging technology that allows you to connect to back-end distributed data and push data in real-time to Adobe Flex and Adobe AIR Rich Internet applications (RIA).
  • 3. Services of BlazeDS The Remoting Service allows your Flex application to directly invoke methods of Java objects deployed in your application server. The Message Service provides a publish/subscribe infrastructure that allows your Flex application to publish messages and subscribe to a messaging destination, enabling the development of real-time data push and collaborative applications. The Proxy Service allows your Flex application to make cross-domain service requests in a secure and controlled manner. It allows your Flex application to access a service available on a different domain than the domain from where the application was downloaded (without having to deploy a crossdomain.xml policy file on the target domain).
  • 7. BlazeDS Message Channels BlazeDS Message Service is a simple publisher-subscriber model. The service configuration could be boiled down to two parts: channels and destinations. In networking terms, destination is the message hub and channel is the transport protocol.
  • 8. Messaging Flex component Producer:You use the Producer component in a Flex application to enable the application to send messages. You can create Producer components in MXML or ActionScript. Consumer:You can create Consumer components in MXML or ActionScript. To subscribe to a destination, you call the Consumer.subscribe() method.
  • 9. Simple Polling Polling is the fool-proof messaging protocol that’s guaranteed to work in most scenarios, but it’s also the slowest and least efficient. The default messaging protocol in BlazeDS uses the simple polling technique. The client pings the server on a regular interval. An empty acknowledgment is returned if there’re no messages for the client,
  • 11. Long Polling To achieve near-real-time messaging, there’s a option called “long polling”. Instead of acknowledging right away, the server could hold the polling request until there’s a message for the client. This ensure the messages are delivered to the client as soon as they become available,
  • 13. Configure Long Polling To add a long polling channel to BlazeDS, open WEB-INF/flex/services-config.xml. Under the channels node, add the channel definition as follows, <channel-definition id="my-long-polling-amf" class="mx.messaging.channels.AMFChannel"> <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling"; class="flex.messaging.endpoints.AMFEndpoint"/> <properties> <polling-enabled>true</polling-enabled> <wait-interval-millis>-1</wait-interval-millis> <polling-interval-millis>100</polling-interval-millis> <max-waiting-poll-requests>50</max-waiting-poll-requests> </properties> </channel-definition>
  • 14. Polling Properties wait-interval-millis dictates how long the server should wait before returning a polling request. polling-interval-millis is the time interval between polling requests. max-waiting-poll-requests caps the number of long polling clients. Since the server is not ackowleging right away during long polling, each client hogs one server thread.
  • 15. Streaming BlazeDS supports real-time message streaming over AMF and HTTP. Unlike long polling, which closes and reopens the connection upon receiving a message, streaming keep the connection open at all times. <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfstreaming"; class="flex.messaging.endpoints.StreamingAMFEndpoint"/> <properties> <idle-timeout-minutes>0</idle-timeout-minutes> <max-streaming-clients>10</max-streaming-clients> <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis> </properties> </channel-definition>
  • 16. Properties max-streaming-clientscontrols the number of concurrent streaming connections on the server. Streaming suffers from the same thread blocking issue as long polling. A cap must be set so the server is not hang by idle threads. idle-time-minutes boots off long idling clients to free up threads. This could help alleviate the threading issue and help prevent misuse.
  • 17. Which Channel to Use? With the slew of channel types available, which one should you choose? Fortunately, you could leave that decision to the run-time environment. The Flex client could be configured with a set of channels types. It will go through the list one at a time until a successful connection could be made.
  • 18. Clerification One last thing I need to clear up is the terminology confusion over the AMF channels and HTTP channels. In the context of BlazeDS channels, AMF refers to binary RPC protocol. HTTP refers to XML RPC protocol. They BOTH run on top of HTTP.
  • 19. Demo
  • 20. Q & A