0

I want to implement Server Push in my Java web application. HTTP Streaming is that I can open a connection with the client and its always open and sends data whenever server gets it. 1. But how is this different from Comet? 2. I want to use server push without using Web Sockets. How can this be achieved?

Nikhil
  • 207
  • 1
  • 3
  • 15

2 Answers2

1

HTTP Streaming is part of Comet. The Comet term was coined to refer to both HTTP Streaming and HTTP Long Polling. Please see this answer for further details: Is Comet obsolete now with Server-Sent Events and WebSocket?

You can use a ready-made Comet server. There are plenty of them, both commercial and free, including closed-hosted and open-source solutions. Some of them support both Comet and WebSockets.

Community
  • 1
  • 1
Alessandro Alinone
  • 4,934
  • 2
  • 18
  • 22
  • For a list of self install and hosted solutions I'm curating a [realtime web tech guide](http://www.leggetter.co.uk/real-time-web-technologies-guide) which may be of interest. There's also a section on the different [realtime web transport mechanisms](http://www.leggetter.co.uk/real-time-web-technologies-guide/realtime-web-technology-transport-mechanisms). – leggetter Jan 10 '13 at 09:35
  • Hi, I have a quesion about HTTP Streaming. I have servlet on some web server (in my case Weblogic but the behaviour is the same regardless of server isnt it?) for downloading files and I plan another for prividing currency rates that are changing 3 times per second (I cant use websockets) I wonder what would happen if 1000 users would download this file or connect to currency rates at the same time ? Each of them would create separate thread? –  Jul 23 '15 at 13:20
0
  1. I want to use server push without using Web Sockets. How can this be achieved?

Servlet specification 3.0 supports asynchronous request which can meet your requirements. But, it's not simple to implement server push system based on that. My recommendation is to use Atmosphere or Portal framework.

Donghwan Kim
  • 1,111
  • 7
  • 18