[ 
https://issues.apache.org/jira/browse/CAMEL-9364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavlo Kletsko updated CAMEL-9364:
---------------------------------
    Estimated Complexity: Novice  (was: Unknown)

> Add ability to receive onOpen/onClose/onError websocket events through camel 
> rout.
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-9364
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9364
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-atmosphere-websocket
>            Reporter: Pavlo Kletsko
>              Labels: patch
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> There is a case when I need to maintain my own map (websocket session key, 
> user object). Consequently I need to receive events from 
> onOpen/onClose/onError methods of websocket protocol and add/remove item from 
> my map. 
> To achieve this :
> 1) I will add special servlet parameter, let's call it "events" with value 
> "true". Which will enable this feature. By default it will be "false" (no 
> parameter needed) and current functionality will not be influenced any how.
> <servlet>
>               <servlet-name>CamelWsServlet</servlet-name>
>               
> <servlet-class>org.apache.camel.component.atmosphere.websocket.CamelWebSocketServlet</servlet-class>
>               <init-param>
>                       <param-name>events</param-name>
>                       <param-value>true</param-value>
>               </init-param>
>               <load-on-startup>2</load-on-startup>
>       </servlet>
> 2) I will change WebsocketHandler sending exchange message with header key 
> such as "websocket.eventType" and possible values :
> ONOPEN_EVENT_TYPE = 1;
> ONCLOSE_EVENT_TYPE = 0;
> ONERROR_EVENT_TYPE = -1;
> to camel rout each time when we trigger onOpen/onClose/onError methods. In 
> addition to this header parameter session key will be send as well. 
> 3) Rout on client side will filter messages by header to distinguish events 
> and their purposes.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to