You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Ean Schuessler <ea...@brainfood.com> on 2014/07/11 19:23:24 UTC

NIO and Tomcat COMET communication

I have just finished up a COMET communication servlet and services
for OFBiz. In order to support COMET I had to enable the NIO
protocol in the Catalina container. From what I have seen, NIO works
for all the OFBiz screens I have tried. I don't think that adding
the NIO support should cause any problems but I also wonder if we
shouldn't make the NIO adapter the default for performance reasons.

I'm going to open a ticket with the patch but I also thought I would
start the discussion.

I will make the servlet component and its services available as a
branch on the Brainfood git repo. I am using it to drive dynamic order
screens on an AJAX oriented financial platform we have built on top
of OFBiz. The display technology is a big departure from the way OFBiz
screen handlers work but I think some aspects of what I'm doing can
be retrofitted onto OFBiz screens, even if it is as simple as 
triggering a page refresh when certain entities are updated.

-- 
Ean Schuessler, CTO
ean@brainfood.com
214-720-0700 x 315
Brainfood, Inc.
http://www.brainfood.com

Re: NIO and Tomcat COMET communication

Posted by Ean Schuessler <ea...@brainfood.com>.
I agree that we would want to revisit the auto-update feature.
The notion of an interval may be obsolete because the data would
get "pushed" when the change occurs rather than polling for it.

That is the reason that NIO is required, so that the new Tomcat
CometEvent classes can be used. They do not function with the
standard HTTP connector.

We could also implement websockets under Tomcat and gracefully
fall back to long polling if the browser doesn't support them.
Even IE does them as of IE9 so we wouldn't exactly be putting
ourselves on the bleeding edge by supporting them.

----- "Jacques Le Roux" <ja...@les7arts.com> wrote:

> +1 for NIO
> 
> It seems more than auto-update-interval and auto-update-target
> attributes would be provided, Ean?
> BTW it would be good if we added an example of use of
> auto-update-interval and auto-update-target
> 
> Also I stumbled upon this recently
> http://www.w3schools.com/html/html5_serversentevents.asp unfortunately
> only real browsers support it
> 
> https://imgur.com/H4lcN ;)

-- 
Ean Schuessler, CTO
ean@brainfood.com
214-720-0700 x 315
Brainfood, Inc.
http://www.brainfood.com

Re: NIO and Tomcat COMET communication

Posted by Jacques Le Roux <ja...@les7arts.com>.
+1 for NIO

It seems more than auto-update-interval and auto-update-target attributes would be provided, Ean?
BTW it would be good if we added an example of use of auto-update-interval and auto-update-target

Also I stumbled upon this recently http://www.w3schools.com/html/html5_serversentevents.asp unfortunately only real browsers support it

https://imgur.com/H4lcN ;)

Jacques

Le 12/07/2014 13:56, Adrian Crum a écrit :
> Thanks Pierre!
>
> The screen widgets already support asynchronous area updates - see the container element auto-update-interval and auto-update-target attributes.
>
> Using NIO seems to be a separate issue, and usually the app server handles that.
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 7/12/2014 12:42 PM, Pierre Smits wrote:
>> Have a look at: http://www.ibm.com/developerworks/library/wa-cometjava/
>>
>> Pierre Smits
>>
>> *ORRTIZ.COM <http://www.orrtiz.com>*
>> Services & Solutions for Cloud-
>> Based Manufacturing, Professional
>> Services and Retail & Trade
>> http://www.orrtiz.com
>>
>>
>> On Sat, Jul 12, 2014 at 12:10 PM, Adrian Crum <
>> adrian.crum@sandglass-software.com> wrote:
>>
>>> It would help if we knew what "COMET" is.
>>>
>>> Adrian Crum
>>> Sandglass Software
>>> www.sandglass-software.com
>>>
>>>
>>> On 7/11/2014 6:23 PM, Ean Schuessler wrote:
>>>
>>>> I have just finished up a COMET communication servlet and services
>>>> for OFBiz. In order to support COMET I had to enable the NIO
>>>> protocol in the Catalina container. From what I have seen, NIO works
>>>> for all the OFBiz screens I have tried. I don't think that adding
>>>> the NIO support should cause any problems but I also wonder if we
>>>> shouldn't make the NIO adapter the default for performance reasons.
>>>>
>>>> I'm going to open a ticket with the patch but I also thought I would
>>>> start the discussion.
>>>>
>>>> I will make the servlet component and its services available as a
>>>> branch on the Brainfood git repo. I am using it to drive dynamic order
>>>> screens on an AJAX oriented financial platform we have built on top
>>>> of OFBiz. The display technology is a big departure from the way OFBiz
>>>> screen handlers work but I think some aspects of what I'm doing can
>>>> be retrofitted onto OFBiz screens, even if it is as simple as
>>>> triggering a page refresh when certain entities are updated.
>>>>
>>>>
>>
>

-- 

Re: NIO and Tomcat COMET communication

Posted by Adrian Crum <ad...@sandglass-software.com>.
Thanks Pierre!

The screen widgets already support asynchronous area updates - see the 
container element auto-update-interval and auto-update-target attributes.

Using NIO seems to be a separate issue, and usually the app server 
handles that.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 7/12/2014 12:42 PM, Pierre Smits wrote:
> Have a look at: http://www.ibm.com/developerworks/library/wa-cometjava/
>
> Pierre Smits
>
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com
>
>
> On Sat, Jul 12, 2014 at 12:10 PM, Adrian Crum <
> adrian.crum@sandglass-software.com> wrote:
>
>> It would help if we knew what "COMET" is.
>>
>> Adrian Crum
>> Sandglass Software
>> www.sandglass-software.com
>>
>>
>> On 7/11/2014 6:23 PM, Ean Schuessler wrote:
>>
>>> I have just finished up a COMET communication servlet and services
>>> for OFBiz. In order to support COMET I had to enable the NIO
>>> protocol in the Catalina container. From what I have seen, NIO works
>>> for all the OFBiz screens I have tried. I don't think that adding
>>> the NIO support should cause any problems but I also wonder if we
>>> shouldn't make the NIO adapter the default for performance reasons.
>>>
>>> I'm going to open a ticket with the patch but I also thought I would
>>> start the discussion.
>>>
>>> I will make the servlet component and its services available as a
>>> branch on the Brainfood git repo. I am using it to drive dynamic order
>>> screens on an AJAX oriented financial platform we have built on top
>>> of OFBiz. The display technology is a big departure from the way OFBiz
>>> screen handlers work but I think some aspects of what I'm doing can
>>> be retrofitted onto OFBiz screens, even if it is as simple as
>>> triggering a page refresh when certain entities are updated.
>>>
>>>
>

Re: NIO and Tomcat COMET communication

Posted by Pierre Smits <pi...@gmail.com>.
Have a look at: http://www.ibm.com/developerworks/library/wa-cometjava/

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


On Sat, Jul 12, 2014 at 12:10 PM, Adrian Crum <
adrian.crum@sandglass-software.com> wrote:

> It would help if we knew what "COMET" is.
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
>
> On 7/11/2014 6:23 PM, Ean Schuessler wrote:
>
>> I have just finished up a COMET communication servlet and services
>> for OFBiz. In order to support COMET I had to enable the NIO
>> protocol in the Catalina container. From what I have seen, NIO works
>> for all the OFBiz screens I have tried. I don't think that adding
>> the NIO support should cause any problems but I also wonder if we
>> shouldn't make the NIO adapter the default for performance reasons.
>>
>> I'm going to open a ticket with the patch but I also thought I would
>> start the discussion.
>>
>> I will make the servlet component and its services available as a
>> branch on the Brainfood git repo. I am using it to drive dynamic order
>> screens on an AJAX oriented financial platform we have built on top
>> of OFBiz. The display technology is a big departure from the way OFBiz
>> screen handlers work but I think some aspects of what I'm doing can
>> be retrofitted onto OFBiz screens, even if it is as simple as
>> triggering a page refresh when certain entities are updated.
>>
>>

Re: NIO and Tomcat COMET communication

Posted by Ean Schuessler <ea...@brainfood.com>.
Not to be crass, but, let me Google that for you:

http://en.wikipedia.org/wiki/Comet_(programming)

----- "Adrian Crum" <ad...@sandglass-software.com> wrote:

> It would help if we knew what "COMET" is.

-- 
Ean Schuessler, CTO
ean@brainfood.com
214-720-0700 x 315
Brainfood, Inc.
http://www.brainfood.com

Re: NIO and Tomcat COMET communication

Posted by Adrian Crum <ad...@sandglass-software.com>.
It would help if we knew what "COMET" is.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 7/11/2014 6:23 PM, Ean Schuessler wrote:
> I have just finished up a COMET communication servlet and services
> for OFBiz. In order to support COMET I had to enable the NIO
> protocol in the Catalina container. From what I have seen, NIO works
> for all the OFBiz screens I have tried. I don't think that adding
> the NIO support should cause any problems but I also wonder if we
> shouldn't make the NIO adapter the default for performance reasons.
>
> I'm going to open a ticket with the patch but I also thought I would
> start the discussion.
>
> I will make the servlet component and its services available as a
> branch on the Brainfood git repo. I am using it to drive dynamic order
> screens on an AJAX oriented financial platform we have built on top
> of OFBiz. The display technology is a big departure from the way OFBiz
> screen handlers work but I think some aspects of what I'm doing can
> be retrofitted onto OFBiz screens, even if it is as simple as
> triggering a page refresh when certain entities are updated.
>