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¶m2=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)