users@grizzly.java.net

RE: Want to migrate from Tomcat Comet to grizzly comet

From: ilya goberman <goberman_at_msn.com>
Date: Tue, 8 Feb 2011 15:37:05 -0600

Alexey, I already described my requirements in previous posts: I want to write Comet infinite HTTP responses to each connected client individually (based on client's subscription requests). I do NOT want to write to ALL clients based on subscription topics. If you look at Tomcat/Comet: http://tomcat.apache.org/tomcat-6.0-doc/aio.html, this is what I want to replace.

You replied to me and recommended using Grizzly 2.0 with asynchronous HTTP API and look at the sample: http://java.net/projects/grizzly/sources/svn/content/branches/2dot0/code/samples/http-server-samples/src/main/java/org/glassfish/grizzly/samples/httpserver/nonblockinghandler/NonBlockingHttpHandlerSample.java

1) I installed Glassfish fine. The next step is to install Grizzly 2.0 and this is where I get confused. Is Grizzly 2.0 already integrated with 3.1 Glassfish, I do not need to do anything, but I suspect it is not. So how do I install Grizzly 2.0 into Glassfish 3.1?

2) Next I need to configure "asynchronous HTTP API". Is it the same as configuring "Comet API" per http://download.oracle.com/docs/cd/E19798-01/821-1752/ggrla/index.html, or it is something different?

3) If I look at the sample http://java.net/projects/grizzly/sources/svn/content/branches/2dot0/code/samples/http-server-samples/src/main/java/org/glassfish/grizzly/samples/httpserver/nonblockinghandler/NonBlockingHttpHandlerSample.java,
I see the lines below:
// create a basic server that listens on port 8080.
final HttpServer server = HttpServer.createSimpleServer();

Does it imply that Grizzly listens on separate port then web container? I want my static web pages to be served on the same server port as Grizzly requests.
Thanks


> Date: Tue, 8 Feb 2011 21:58:19 +0100
> From: oleksiy.stashok_at_oracle.com
> To: users_at_grizzly.java.net
> Subject: Re: Want to migrate from Tomcat Comet to grizzly comet
>
> If you need a servlet container - it'd make sense to use Glassfish (I'd
> recommend the latest 3.1 RC, with the latest Grizzly integrated). The
> web profile, as Justin mentioned, should be enough.
>
> Here are instructions [1] how comet should be enabled on GF.
>
> Grizzly comet samples are here [2].
>
> I remember you asked about CometContext-per-Client, not sure it's good
> idea :(
> If you can describe your usecase, may be we can discuss better approach.
>
> Thanks.
>
> WBR,
> Alexey.
>
> [1] http://download.oracle.com/docs/cd/E19798-01/821-1752/ggrla/index.html
> [2]
> http://java.net/projects/grizzly/sources/svn/show/trunk/code/samples/comet
>
> On 02/08/2011 07:43 PM, goberman_at_msn.com wrote:
> > Alexey, I looked at docbook documentation last week. It shows how to
> > run a standalone Java sample that is configured to listen on port 80
> > for incoming connection requests.
> > I am looking for a way to integrate grizzly with a "servlet container",
> > like Tomcat (or Glassfish) and I am struggling to fund any
> > documentation addressing it.
> > It should confirm to the following requirements:
> >
> > 1) Server port should be configured in the "servlet container", not in
> > grizzly. Grizzly should be "plugged into" container.
> > 2) I should be able to serve both static web pages and handle HTTP
> > Comet requests via Grizzly on the same server port. This is what
> > Tomcat/Comet allows me to do now. I do not want to serve web pages on
> > port X and Grizzly requests on port Y.
> >
> > Any chance of a quick guide on how to accomplish it? Or it is not
> > possible?
>