You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cmoulliard <cm...@gmail.com> on 2008/10/10 10:50:59 UTC

Suggestion : add a new component to work with NIO framework like comet/grizzly !

Hi,

May I suggest to create a new component that will allow Camel to communicate
with NIO framework like comet/grizzly, ... (more information about what you
can do with such framework can be found here :
http://www.tutorialized.com/view/tutorial/Create-event-driven-Web-apps-using-Continuous-and-Reverse-Ajax/27495,
http://www.ibm.com/developerworks/web/library/j-jettydwr/)

When you design a reverse ajax application where you use push technology at
the serverside, you need to use a servlet modified using NIO. Such servlet
modified already exist in Tomcat/Jetty and Grizzly because they implement
the comet framework. Next, in order for a client to be notified (through
push technology) that something happens at the server side, an event
listener must be created and link to the comet API. Every time that an
action occurs, the event will send back the information to the brower. such
technology already works today in DWR package (Direct Web Remoting),
Google/Gears, Flex/BlazeDS but need a lot of coding to link the events with
the framework.

My proposition is to integrate Camel with Comet in such a way that we can
work with Comet/event. A comet/event could be exposed as an endpoint to
allow to use it through the routing.

e.g.

Imagine that every time a message (order, status updated about a parcel to
be delivered, ...) arrives through a message queue, then we have to inform
our web user who has subscribed to receive such information.

At the servlet/comet side, we have to create an event or maybe a spring
event and publish it. For the moment, I don't know where this one should be
published (into camel, grizzly bus, ....) ! This point must be tackled
before to go one step further. The event published will be linked to a user
when this one will call the service from its web browser. Comet through the
continuation api will add the user the list of users to be notified.

At the camel side, the idea is to use the routing as usual :

from(jms:queue)
to(comet:event)

When a message arrives in the queue, we send it to the comet:event endpoint

Charles Moulliard
 

-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/Suggestion-%3A-add-a-new-component-to-work-with-NIO-framework-like-comet-grizzly-%21-tp19914446s22882p19914446.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Suggestion : add a new component to work with NIO framework like comet/grizzly !

Posted by cmoulliard <cm...@gmail.com>.
Hi Willem,

The current jetty-component implementation covers the "continuation"
mechanism (org.mortbay.ajax.Continuation) allowing to work in a asynchronous
way between a browser and the client. In this case, the client is
responsible to call the server.

Jetty proposes also an implementation of Comet (who will be integrated in
Servlet 3.0 specification (http://jcp.org/en/jsr/detail?id=315)). With
Comet, we can design a solution where the server can talk to the client
connected. The connection can be of type "streaming" or "poll". 

It could be interesting to implement also the classes org.mortbay.cometd.*
in this jetty component in order to fire through an event or listener a
reply to a web browser client ?

Regards,

Charles



willem.jiang wrote:
> 
> Hi Charles,
> 
> Current Camel-Jetty component is using the Jetty's continuation API[1]
> to implement asynchronous processing[2]. Maybe you can take it a
> reference.
> 
> [1]https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
> [2]http://cwiki.apache.org/CAMEL/asynchronous-processing.html
> 
> Willem
> 
> cmoulliard wrote:
>> Hi,
>> 
>> May I suggest to create a new component that will allow Camel to
>> communicate
>> with NIO framework like comet/grizzly, ... (more information about what
>> you
>> can do with such framework can be found here :
>> http://www.tutorialized.com/view/tutorial/Create-event-driven-Web-apps-using-Continuous-and-Reverse-Ajax/27495,
>> http://www.ibm.com/developerworks/web/library/j-jettydwr/)
>> 
>> When you design a reverse ajax application where you use push technology
>> at
>> the serverside, you need to use a servlet modified using NIO. Such
>> servlet
>> modified already exist in Tomcat/Jetty and Grizzly because they implement
>> the comet framework. Next, in order for a client to be notified (through
>> push technology) that something happens at the server side, an event
>> listener must be created and link to the comet API. Every time that an
>> action occurs, the event will send back the information to the brower.
>> such
>> technology already works today in DWR package (Direct Web Remoting),
>> Google/Gears, Flex/BlazeDS but need a lot of coding to link the events
>> with
>> the framework.
>> 
>> My proposition is to integrate Camel with Comet in such a way that we can
>> work with Comet/event. A comet/event could be exposed as an endpoint to
>> allow to use it through the routing.
>> 
>> e.g.
>> 
>> Imagine that every time a message (order, status updated about a parcel
>> to
>> be delivered, ...) arrives through a message queue, then we have to
>> inform
>> our web user who has subscribed to receive such information.
>> 
>> At the servlet/comet side, we have to create an event or maybe a spring
>> event and publish it. For the moment, I don't know where this one should
>> be
>> published (into camel, grizzly bus, ....) ! This point must be tackled
>> before to go one step further. The event published will be linked to a
>> user
>> when this one will call the service from its web browser. Comet through
>> the
>> continuation api will add the user the list of users to be notified.
>> 
>> At the camel side, the idea is to use the routing as usual :
>> 
>> from(jms:queue)
>> to(comet:event)
>> 
>> When a message arrives in the queue, we send it to the comet:event
>> endpoint
>> 
>> Charles Moulliard
>>  
>> 
>> -----
>> Enterprise Architect
>> 
>> Xpectis
>> 12, route d'Esch
>> L-1470 Luxembourg
>> 
>> Phone +352 25 10 70 470
>> Mobile +352 621 45 36 22
>> 
>> e-mail : cmoulliard@xpectis.com
>> web site :  www.xpectis.com www.xpectis.com 
>> My Blog :  http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.com/  
> 
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/Suggestion-%3A-add-a-new-component-to-work-with-NIO-framework-like-comet-grizzly-%21-tp19914446s22882p20009731.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Suggestion : add a new component to work with NIO framework like comet/grizzly !

Posted by Willem Jiang <wi...@gmail.com>.
Hi Charles,

Current Camel-Jetty component is using the Jetty's continuation API[1]
to implement asynchronous processing[2]. Maybe you can take it a reference.

[1]https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
[2]http://cwiki.apache.org/CAMEL/asynchronous-processing.html

Willem

cmoulliard wrote:
> Hi,
> 
> May I suggest to create a new component that will allow Camel to communicate
> with NIO framework like comet/grizzly, ... (more information about what you
> can do with such framework can be found here :
> http://www.tutorialized.com/view/tutorial/Create-event-driven-Web-apps-using-Continuous-and-Reverse-Ajax/27495,
> http://www.ibm.com/developerworks/web/library/j-jettydwr/)
> 
> When you design a reverse ajax application where you use push technology at
> the serverside, you need to use a servlet modified using NIO. Such servlet
> modified already exist in Tomcat/Jetty and Grizzly because they implement
> the comet framework. Next, in order for a client to be notified (through
> push technology) that something happens at the server side, an event
> listener must be created and link to the comet API. Every time that an
> action occurs, the event will send back the information to the brower. such
> technology already works today in DWR package (Direct Web Remoting),
> Google/Gears, Flex/BlazeDS but need a lot of coding to link the events with
> the framework.
> 
> My proposition is to integrate Camel with Comet in such a way that we can
> work with Comet/event. A comet/event could be exposed as an endpoint to
> allow to use it through the routing.
> 
> e.g.
> 
> Imagine that every time a message (order, status updated about a parcel to
> be delivered, ...) arrives through a message queue, then we have to inform
> our web user who has subscribed to receive such information.
> 
> At the servlet/comet side, we have to create an event or maybe a spring
> event and publish it. For the moment, I don't know where this one should be
> published (into camel, grizzly bus, ....) ! This point must be tackled
> before to go one step further. The event published will be linked to a user
> when this one will call the service from its web browser. Comet through the
> continuation api will add the user the list of users to be notified.
> 
> At the camel side, the idea is to use the routing as usual :
> 
> from(jms:queue)
> to(comet:event)
> 
> When a message arrives in the queue, we send it to the comet:event endpoint
> 
> Charles Moulliard
>  
> 
> -----
> Enterprise Architect
> 
> Xpectis
> 12, route d'Esch
> L-1470 Luxembourg
> 
> Phone +352 25 10 70 470
> Mobile +352 621 45 36 22
> 
> e-mail : cmoulliard@xpectis.com
> web site :  www.xpectis.com www.xpectis.com 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  


RE: Suggestion : add a new component to work with NIO framework like comet/grizzly !

Posted by cmoulliard <cm...@gmail.com>.
Hi Claus,

I have added a new feature in JIRA for this component.

Kind regards,

Charles Moulliard


Claus Ibsen wrote:
> 
> Hi
> 
> Yeah feel free to add the ticket. Then it's not forgotten and it's based
> on real need by end-users.
> 
> Also the community can see this and be able to contribute to this ticket.
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> 
> -----Original Message-----
> From: cmoulliard [mailto:cmoulliard@gmail.com] 
> Sent: 10. oktober 2008 10:51
> To: camel-user@activemq.apache.org
> Subject: Suggestion : add a new component to work with NIO framework like
> comet/grizzly !
> 
> 
> Hi,
> 
> May I suggest to create a new component that will allow Camel to
> communicate
> with NIO framework like comet/grizzly, ... (more information about what
> you
> can do with such framework can be found here :
> http://www.tutorialized.com/view/tutorial/Create-event-driven-Web-apps-using-Continuous-and-Reverse-Ajax/27495,
> http://www.ibm.com/developerworks/web/library/j-jettydwr/)
> 
> When you design a reverse ajax application where you use push technology
> at
> the serverside, you need to use a servlet modified using NIO. Such servlet
> modified already exist in Tomcat/Jetty and Grizzly because they implement
> the comet framework. Next, in order for a client to be notified (through
> push technology) that something happens at the server side, an event
> listener must be created and link to the comet API. Every time that an
> action occurs, the event will send back the information to the brower.
> such
> technology already works today in DWR package (Direct Web Remoting),
> Google/Gears, Flex/BlazeDS but need a lot of coding to link the events
> with
> the framework.
> 
> My proposition is to integrate Camel with Comet in such a way that we can
> work with Comet/event. A comet/event could be exposed as an endpoint to
> allow to use it through the routing.
> 
> e.g.
> 
> Imagine that every time a message (order, status updated about a parcel to
> be delivered, ...) arrives through a message queue, then we have to inform
> our web user who has subscribed to receive such information.
> 
> At the servlet/comet side, we have to create an event or maybe a spring
> event and publish it. For the moment, I don't know where this one should
> be
> published (into camel, grizzly bus, ....) ! This point must be tackled
> before to go one step further. The event published will be linked to a
> user
> when this one will call the service from its web browser. Comet through
> the
> continuation api will add the user the list of users to be notified.
> 
> At the camel side, the idea is to use the routing as usual :
> 
> from(jms:queue)
> to(comet:event)
> 
> When a message arrives in the queue, we send it to the comet:event
> endpoint
> 
> Charles Moulliard
>  
> 
> -----
> Enterprise Architect
> 
> Xpectis
> 12, route d'Esch
> L-1470 Luxembourg
> 
> Phone +352 25 10 70 470
> Mobile +352 621 45 36 22
> 
> e-mail : cmoulliard@xpectis.com
> web site :  www.xpectis.com www.xpectis.com 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
> -- 
> View this message in context:
> http://www.nabble.com/Suggestion-%3A-add-a-new-component-to-work-with-NIO-framework-like-comet-grizzly-%21-tp19914446s22882p19914446.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/Suggestion-%3A-add-a-new-component-to-work-with-NIO-framework-like-comet-grizzly-%21-tp19914446s22882p19955096.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Suggestion : add a new component to work with NIO framework like comet/grizzly !

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Yeah feel free to add the ticket. Then it's not forgotten and it's based on real need by end-users.

Also the community can see this and be able to contribute to this ticket.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: cmoulliard [mailto:cmoulliard@gmail.com] 
Sent: 10. oktober 2008 10:51
To: camel-user@activemq.apache.org
Subject: Suggestion : add a new component to work with NIO framework like comet/grizzly !


Hi,

May I suggest to create a new component that will allow Camel to communicate
with NIO framework like comet/grizzly, ... (more information about what you
can do with such framework can be found here :
http://www.tutorialized.com/view/tutorial/Create-event-driven-Web-apps-using-Continuous-and-Reverse-Ajax/27495,
http://www.ibm.com/developerworks/web/library/j-jettydwr/)

When you design a reverse ajax application where you use push technology at
the serverside, you need to use a servlet modified using NIO. Such servlet
modified already exist in Tomcat/Jetty and Grizzly because they implement
the comet framework. Next, in order for a client to be notified (through
push technology) that something happens at the server side, an event
listener must be created and link to the comet API. Every time that an
action occurs, the event will send back the information to the brower. such
technology already works today in DWR package (Direct Web Remoting),
Google/Gears, Flex/BlazeDS but need a lot of coding to link the events with
the framework.

My proposition is to integrate Camel with Comet in such a way that we can
work with Comet/event. A comet/event could be exposed as an endpoint to
allow to use it through the routing.

e.g.

Imagine that every time a message (order, status updated about a parcel to
be delivered, ...) arrives through a message queue, then we have to inform
our web user who has subscribed to receive such information.

At the servlet/comet side, we have to create an event or maybe a spring
event and publish it. For the moment, I don't know where this one should be
published (into camel, grizzly bus, ....) ! This point must be tackled
before to go one step further. The event published will be linked to a user
when this one will call the service from its web browser. Comet through the
continuation api will add the user the list of users to be notified.

At the camel side, the idea is to use the routing as usual :

from(jms:queue)
to(comet:event)

When a message arrives in the queue, we send it to the comet:event endpoint

Charles Moulliard
 

-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/Suggestion-%3A-add-a-new-component-to-work-with-NIO-framework-like-comet-grizzly-%21-tp19914446s22882p19914446.html
Sent from the Camel - Users mailing list archive at Nabble.com.