[ 
https://issues.apache.org/jira/browse/CAMEL-9364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15028427#comment-15028427
 ] 

ASF GitHub Bot commented on CAMEL-9364:
---------------------------------------

GitHub user pkletsko opened a pull request:

    https://github.com/apache/camel/pull/697

    [CAMEL-9364] Add ability to receive onOpen/onClose/onError websocket …

    …events through camel rout.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pkletsko/camel CAMEL-9364

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/697.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #697
    
----
commit 011482b4f8c22de5713dc85c8b7ae9f9b613cca2
Author: Pavlo Kletsko <pklet...@gmail.com>
Date:   2015-11-26T09:30:04Z

    [CAMEL-9364] Add ability to receive onOpen/onClose/onError websocket events 
through camel rout.

----


> 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
>             Fix For: 2.17.0
>
>   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