667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 10 Messages: 10 Messages: 10 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Jonathan Downes on "What is Reverse Ajax?"

Posted by: Joseph Ottinger on May 25, 2006 DIGG
Jonathan Downes has written an article called "What is Reverse Ajax?," addressing the definition of this 'new technique' - which is actually a set of older techniques combined under a single name, much like Ajax itself is.
The Problem. But what if you want to build a highly interactive application that adds updates to your page as soon as someone half way around the world updates theirs? What if you are in a CMS interface and you go to check out some content and find you colleague in marketing checked it out 2 minutes ago, but the page you are looking at hasn't been updated since then? What if you are writing an article on Reverse Ajax using Writely and your technical editor just updated the paragraph you were going to work on? These are essentially monitoring and multi-user applications.

The browser does the asking. The problem is that web servers can't easily contact web browsers. For one thing firewalls will get in the way, and even if they didn't, browsers only listen for answers to questions they've asked. So how is the web server to get the message through?
As the article explains, Ajax is traditionally a mechanism by which a browser pulls data on an ad hoc basis from a server. However, Joe Walker's DWR library has implemented Reverse Ajax, which is an implementation of three techniques for providing updates to a browser on a regular basis: browser polling, long-lived HTTP requests (the 'Comet' approach), and piggybacking responses (in which the response for one Ajax request is delayed until the next Ajax request is made from the browser).

Threaded replies

·  Jonathan Downes on "What is Reverse Ajax?" by Joseph Ottinger on Thu May 25 07:18:27 EDT 2006
  ·  What is Reverse Ajax? - Easy by John Davies on Thu May 25 19:01:50 EDT 2006
  ·  Re: Jonathan Downes on "What is Reverse Ajax?" by Sergey Smirnov on Thu May 25 19:32:47 EDT 2006
  ·  Re: Jonathan Downes on "What is Reverse Ajax?" by Ted Goddard on Fri May 26 11:25:04 EDT 2006
  ·  Re: Jonathan Downes on "What is Reverse Ajax?" by Roger Voss on Sat May 27 18:49:13 EDT 2006
    ·  server-side message push over HTTP Streaming by Roger Voss on Sat May 27 19:17:37 EDT 2006
  ·  Re: Jonathan Downes on "What is Reverse Ajax?" by Ravi Chamarthy on Mon May 29 00:57:34 EDT 2006
  ·  Don't think that it is important to coin more buzzwords by Frank Nimphius on Mon May 29 06:03:20 EDT 2006
    ·  Or how about Ajax Push? by paul browne on Thu Jun 01 07:32:48 EDT 2006
  ·  Lightstreamer for Reverse Ajax by Alessandro Alinone on Mon Jun 19 02:59:55 EDT 2006
  ·  Try StreamHub for a Mature Reverse Ajax Server by David Turnstall on Thu Aug 20 19:45:17 EDT 2009
  Message #209802 Post reply Post reply Post reply Go to top Go to top Go to top

What is Reverse Ajax? - Easy

Posted by: John Davies on May 25, 2006 in response to Message #209736
Xaja!

:-)

-John-

  Message #209804 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Jonathan Downes on "What is Reverse Ajax?"

Posted by: Sergey Smirnov on May 25, 2006 in response to Message #209736
One more bastion is fallen. We are living in very interesting time when features that used to be considered not for web becomes publicly announced as features of thin client. I am not going to be wonder if somebody announce how to disable that annoying back button and keep the connection alive after user closes the browser for a coffee break :-)
Anyway, thanks to Jonathan to classify the new technique features. Now, we have some job to do.

Sergey: https://ajax4jsf.dev.java.net/

  Message #209866 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Jonathan Downes on "What is Reverse Ajax?"

Posted by: Ted Goddard on May 26, 2006 in response to Message #209736
For ICEfaces we're now calling this feature "application-initiated" AJAX. Originally (such as at JavaOne last year) we were simply calling it "Asynchronous", but taking Asynchronous to its fullest extent. That is, network operations are fully decoupled from user actions -- not only does the browser not lock up when you send a message to the server, the server can send a message to the browser independently of what the user does.

The ability for the application on the server to update the page at any time is what makes AJAX revolutionary -- it turns the web into a new communication medium.

  Message #209978 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Jonathan Downes on "What is Reverse Ajax?"

Posted by: Roger Voss on May 27, 2006 in response to Message #209736
A few geological eras ago "reverse Ajax" was simply referred to as server-side push. Indeed, back in the primeval times of the Internet, Netscape devised a protocol specifically for server-side push of data over an HTTP connection to a browser. It may be hard to believe for some but this old Netscape protocol has been in use ever since. For instance, in my software applications I support streaming MJPEG video from a Panasonic NT109 video encoder that uses this Netscape protocol. Any Netscape, Mozilla, or Firefox browser can HTTP connect to this video encoder and start receiving streaming video directly in a plain web page. (IE users are out of luck - the first frame of image data and then nothing.)

The Axis video encoder uses a very similar protocol but alas is slight different for the frame separators so hence their ActiveX control has to be used to receive their MJPEG.

The Wikipedia also has a definition for this. It refers to it as HTTP Streaming. This definition is just the general notion of leaving an HTTP connection open to the client so that the server can continue to send subsequent notification data to the client. Again, an IE browser will have to reopen the connection after ever message is received on an XMLHttpRequest connection, while any of the Netscape/Mozilla/Firefox family of browsers will be able to receive messages indefinitely over the same open XMLHttpRequest connection. The Wikipedia HTTP Streaming concept does not mandate any particular message body separator as did the old Netscape server-side push protocol.

  Message #209979 Post reply Post reply Post reply Go to top Go to top Go to top

server-side message push over HTTP Streaming

Posted by: Roger Voss on May 27, 2006 in response to Message #209978
BTW, if you implement HTTP Streaming and you want to support the IE browser (which has the problem in that it closes an XMLHttpRequest connection after response data is received), then is best to implement message queuing over on the server-side. That way an IE browser will not miss any important messages during the time it is disconnected and has to re-establish its HTTP Streaming connection via XMLHttpRequest.

So if you're now going to have to have message queues so that the client browsers never miss seeing their notification messages, well you might as well leverage JMS for that. You're JEE app server has JMS as its part of the JEE spec. Server-side code will then simply publish JMS messages to a JMS queue or topic in order to push out notifications to web browser clients.

Okay, now we're essentially talking about devising a message bridge between lots of web browser clients and a JMS messaging server. And because we're going to do this over the Internet we need to support thousands of simultaneous, persistent XMLHttpRequest connections per a physical server. Hmm, we need to dump the traditional tomcat servlet engine that consumes a thread per each connection and instead devise a server based on Java NIO. Then we can scale up to 10000 concurrent, persistent connections per physical server (we'll only need a relative handful of connections that connect on over to the JMS server).

So this special HTTP Streaming server uses Java NIO to manage XMLHttpRequest connections on the front-side of the message bridge and then traditional Java IO connections to the JMS server on the back-side of the bridge. We'll work some soft of memory pipe and make use of Java Concurrency Executor thread pools to mediate the bi-directional transfer of message data.

Well, turns out Sun at JavaOne was promoting their Grizzly NIO framework - which they used to build their Glassfish JEE application server - as a general purpose, open source endeavor. So there you have it. Grab Grizzly and build yourself an HTTP Streaming server so that AJAX web applications can enjoy bi-directional JMS messaging. Starting with Grizzly should save about 3/4 if the overall effort.

  Message #210023 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Jonathan Downes on "What is Reverse Ajax?"

Posted by: Ravi Chamarthy on May 29, 2006 in response to Message #209736
Looking closer to the 3 techniques, as put forwarded by DWR

Polling -- There is hardly anything to speak about Polling technique, as this is a age old technique for getting the updates from Server, but this is not a true Server Push technology and only an alternative. Also, the client should be intelligent enough to know when the data is available at the server side to poll the data.

Comet, long lived Http, or the slow load technique -- You would always see the annoying message something like "Waiting for xyz.com..." as the browser status and the page always, indefinitely, loads the page. I really wonder about the scalability for number of connections.

PiggyBack Technique: Here the server, having an update (or for that matter a bucket of huge updates) to send, waits for the next time the browser asks it a question and blows out the updates, and hence the answer. This looks like a refined polling technique where the Client should, again, be intelligent enough to know when to ask the server for the new data.

Are these 3 techniques really server push?

Ravi.

  Message #210035 Post reply Post reply Post reply Go to top Go to top Go to top

Don't think that it is important to coin more buzzwords

Posted by: Frank Nimphius on May 29, 2006 in response to Message #209736
You don't make a technology interesting by coining more buzzwords. If you think that Reverse Ajax is needed then here are my suggestions for more unnecessary acronymns

Ajax-WS for - Ajax with Web services
Ajax-ACID - for transactional Ajax
Ajax-Reliability - to ensure reliability of execution or asynchronous Ajax requests
Ajax-Security
Ajax-I - for interoperability of Ajax with browsers

etc.

Frank

  Message #210396 Post reply Post reply Post reply Go to top Go to top Go to top

Or how about Ajax Push?

Posted by: paul browne on June 01, 2006 in response to Message #210035
Or how about Ajax Push?

Paul

  Message #211639 Post reply Post reply Post reply Go to top Go to top Go to top

Lightstreamer for Reverse Ajax

Posted by: Alessandro Alinone on June 19, 2006 in response to Message #209736
Useful recap on this topic. Just to add a reference to actual solutions, Lightstreamer (www.lightstreamer.com) is a mature product that has implemented "Reverse Ajax" for five years (of course with a different terminology... :-)). Just look at the online demos to glance at Reverse Ajax. For a paper that compares the different paradigms to implement Reverse Ajax, refer to Changing the Web Patadigm.

  Message #319324 Post reply Post reply Post reply Go to top Go to top Go to top

Try StreamHub for a Mature Reverse Ajax Server

Posted by: David Turnstall on August 20, 2009 in response to Message #209736
If you're looking to implement reverse ajax or comet - I'd recommend you take a look at StreamHub Reverse Ajax Server.

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map