Skip to main content

Session Review: TS-8434 Ajax Push (Comet) with JBI

Posted by jhurley on May 10, 2007 at 9:21 PM PDT

I attended the session TS-8434: Ajax Push (a.k.a. Comet) with Java Business Integration (JBI) this afternoon. Here's a report...

The room was very packed and there was a long line of people (including me)
waiting in the 'standby line' to get in. Overall the talk was pretty good. I thought the
speaker did a good job laying things out and explaining them. The "Demo" he did was
*very* difficult to see on the screen, and a bit hard to follow. I was drawn to the session by
the abstract ("This session shows how to push your critical business information out to
Ajax clients and the browser--with lower latency and without compromising scalability or
system performance.

If you're not familiar with Ajax Push (Comet), there's a very good article, href="">Why Ajax
Comet?, that you might want to check out.

Here are some of my notes from the session:

* What is Ajax Push Good For?

  • Use it to create highly responsive, event-driven applications
    in a browser
  • Pros: compared to (standard) Ajax -- lower latency (not dependent
    on polling frequency)
  • Example apps: Gmail and Google Talk, KnowNow, JotLive, etc

* How does "Push" to a Browser work? (pushing data to a browser)

  • Deliver data over a previously opened connection... always "keep a
    connection open" (back channel)

* Architectural Challenges

  • Using blocking, synchronous techn will result in a blocked thread
    for each open connection that is "waiting"
    • will consume memory
    • lowers scalability and can effect perf
    • to get the JVM to scale up to 10K threads+ needs
      specific tuning and is not an efficient way to do this

* Technology Solutions - use NIO non-blocking sockets to
avoid blocking a thread per connection, use technologies that support
asynchronous request processing.

* How does JBI fit into the picture?

  • the JBI 1.0 (JSR 208) framework provides the basis for building
    loosely coupled composite apps by combining services
  • JBI is inherently async, which complements the async nature
    of Ajax Push

* Potential drawbacks and pitfalls

  • beware of flooding clients with too many events
    (don't go overboard pushing out events too rapidly)
  • firewalls may terminate connections after a certain
    amount of time
  • solution: re-establish connection after tear-down or at certain intervals
  • Re: security -- very similar to standard Ajax apps

* Summary

  • pushing data to the web client can form a crucial tool in the dev arsenal when latency is impt
  • "long poll" is straight forward and portable
  • "streaming" today is more complex and has portability implications
  • JBI complements the async nature of Ajax push
Related Topics >>