You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Pavlo Kletsko (JIRA)" <ji...@apache.org> on 2015/12/04 16:45:10 UTC

[jira] [Created] (CAMEL-9392) Add ability to pass parameters within websocket url and handle them in onOpen event

Pavlo Kletsko created CAMEL-9392:
------------------------------------

             Summary: Add ability to pass parameters within websocket url and handle them in onOpen event 
                 Key: CAMEL-9392
                 URL: https://issues.apache.org/jira/browse/CAMEL-9392
             Project: Camel
          Issue Type: Bug
          Components: camel-atmosphere-websocket
            Reporter: Pavlo Kletsko
             Fix For: 2.17.0


To give more dynamic for my app I need to send some additional information at the moment client connect to server through websocket. 

So the URL will be like :
ws://localhost:" + PORT + "/hola1?param1=value1&param2=value2

There is no limit of parameters for that moment of time.

To use this parameters : they will be added to header as key/value and send with onOpen event.

Solution:
1) create map when service method is called at WebsocketConsumer such as this.queryMap = getQueryMap(request.getQueryString());

2) add them to header when sendEventNotification triggered :
        for (Map.Entry<String, String> param : queryMap.entrySet()) {
             exchange.getIn().setHeader(param.getKey(), param.getValue());
        }






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