users@grizzly.java.net

Re: Unified ports with Grizzly Servlet container/Glassfish?

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Sat, 12 Dec 2009 18:48:57 +0100

Hi Greg,

> 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?
If MQ will implement Grizzly ProtocolFilter and ProtocolFinder - then
yes. But for now AFAIK MQ doesn't have that.


> 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?
Grizzly supports multiple adapters. Which kind of WebApps do you have?
It's servlets or something else?


> 3. My misunderstanding. Will be post FCS.
Right.

> 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.
Servlet 2.5 - yes,
3.0 is supported in GFv3 only (at least for now), though Grizzly has
its own ways to support Async HTTP request processing and Comet.

> The example link uses trunk -- is this 2.0 or 1.9? Which shipped
> with GFv3?
1.9 (for both questions).

> 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.
You can use either 1.9.18-k tag... It's what is integrated into GFv3,
or use trunk - it's development branch.
Please take a look at http and servlet modules'es tests and also use
link I've sent you last time as guide.

If you'll have any questions - please ask.

WBR,
Alexey.

>
> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>