users@grizzly.java.net

Re: Unified ports with Grizzly Servlet container/Glassfish?

From: Gregory Gerard <ggerard_at_mac.com>
Date: Fri, 11 Dec 2009 15:10:24 -0800

Thanks, Alexey!

1. I'd seen that HTTP and SOAP/TCP were officially unified, but in the requirements section for the GF3, I saw all the ports that needed to be open. Are you saying that I can turn on PU for MQ?

2. So I can use Grizzly as my entire WebApp container? Are their any gotchas? Can it support multiple webapps at once or is it just at a time?

3. My misunderstanding. Will be post FCS.

4. Would prefer not to have too many cooks so 100% Grizzly would be just fine so long as it can run a 2.5 or 3.0 WebApp.

The example link uses trunk -- is this 2.0 or 1.9? Which shipped with GFv3?

What's the right source tree to check out for this kind of work? I'm checking out trunk since that's where your samples are relative to but not sure of the volatility.

thanks again,
greg

On Dec 11, 2009, at 06:30, Oleksiy Stashok wrote:

> Hi Greg,
>
>> Will try the user list first since this is a getting started question and might be one of configuration.
>>
>> Using Tomcat right now to host several webapps with one webapp doing it's own NIO listener for a custom protocol.
>>
>> I would like to unify these with Grizzly.
>>
>> I would like to have just 8080/8081 (or other port pair for clear and TLS, but that's the only difference).
>>
>> 1. Can someone point me to a backgrounder on port unification in general -- I'm seeing stuff from years ago rather than more recent stuff. https://glassfish.dev.java.net/issues/show_bug.cgi?id=4322 seems to have reduced this from the "One Port To Rule Them All" teaser.
> Actually we have port unification implementation for v3, but we didn't have time to create CLI commands to support it, so PU feature in GFv3 is not official, but still usable.
>
>> 2. If I just want to do HTTP and a non-HTTP protocol with just Servlet container support (Tomcat replacement), what would I need to do?
> You can start from implementing feature you want on Grizzly level, then you might want to think about GFv3 migration.
>
>> 3. Would #2 be portable to GlassFish v3 with all the clustering, load balancing, and other -ings that GF can do.
> In future - yes, but so far, AFAIK, GFv3 doesn't have clustering support.
>
>> 4. I've seen a Jetty+Grizzly out there -- is this the preferred melding or should I use just Grizzly?
> I think Grizzly is a good point to start, then it's up to you.
>
>> I've looked at the Grizzly site and I don't see anything that matches.
> If you're interested in perspective to deploy your app to GFv3 - I'd recommend to use Grizzly config module, which will let you configure PortUnification using description file, which is the same with GFv3.
> Please take a look at the following sample [1] and configurations [2]. On mentioned sample you'll see how we configure port unification for HTTP + XProtocol.
>
>
> In order to use custom servlet - you have to create grizzly ServletAdapter like:
> ServletAdapter adapter = new ServletAdapter();
> adapter.setRootFolder("/tmp/hudson");
> adapter.setHandleStaticResources(true);
> adapter.setContextPath("/hudson");
> Servlet servlet = getServlet();
> adapter.setServletInstance(servlet);
>
> Then you need to set ServletAdapter:
>
> 1) List<GrizzlyServiceListeners> listeners = grizzlyConfig.getListeners();
> 2) for each listener do listener.getEmbeddedHttp().setAdapter(...);
>
> If you'll have any question or need more details - let me know.
>
> WBR,
> Alexey.
>
> [1] https://grizzly.dev.java.net/source/browse/grizzly/trunk/code/modules/config/src/test/java/com/sun/grizzly/config/PUGrizzlyConfigTest.java?rev=3490&view=markup
> [2] https://grizzly.dev.java.net/source/browse/grizzly/trunk/code/modules/config/src/test/resources/
>
>
>>
>> thanks,
>> greg
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>