Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E9F21895F for ; Sat, 21 Nov 2015 20:41:11 +0000 (UTC) Received: (qmail 85595 invoked by uid 500); 21 Nov 2015 20:41:11 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 85542 invoked by uid 500); 21 Nov 2015 20:41:11 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 85516 invoked by uid 99); 21 Nov 2015 20:41:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Nov 2015 20:41:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 046902C0450 for ; Sat, 21 Nov 2015 20:41:11 +0000 (UTC) Date: Sat, 21 Nov 2015 20:41:10 +0000 (UTC) From: "Ton Swieb (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-9348) Endpoints for the same websocket with different parameters cannot send message to websocket client MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Ton Swieb created CAMEL-9348: -------------------------------- Summary: Endpoints for the same websocket with different parameters cannot send message to websocket client Key: CAMEL-9348 URL: https://issues.apache.org/jira/browse/CAMEL-9348 Project: Camel Issue Type: Bug Components: camel-websocket Affects Versions: 2.15.4, 2.16.0, 2.17.0 Reporter: Ton Swieb Having multiple routes with the same websocket consumer/producer causes only the first route to initialize correctly when the endpoint parameters are different per used consumer/producer endpoint URI. In the following example only the first route to register the websocket endpoint will work. The second route will not work. {code} from("websocket://localhost:" + port + "/bar") .transform().simple("The bar has ${body}") .to("websocket://localhost:" + port + "/bar"); from("timer://foo?fixedRate=true&period=12000") .setBody(constant("Broadcasting to Bar")) .to("websocket://localhost:" + port + "/bar?sendToAll=true"); {code} When the endpoint parameters are the same and a header value is used for broadcasting then both routes will work as expected: {code} from("websocket://localhost:" + port + "/bar") .transform().simple("The bar has ${body}") .to("websocket://localhost:" + port + "/bar"); from("timer://foo?fixedRate=true&period=12000") .setBody(constant("Broadcasting to Bar")) .setHeader(WebsocketConstants.SEND_TO_ALL,constant(true)) .to("websocket://localhost:" + port + "/bar"); {code} The NodeSynchronization / WebSocketStore which contains all registered clients is maintained per endpoint and only the NodeSynchronization of the 1st registered endpoint is linked to the WeboscketServlet. The NodeSynchronization of all subsequent endpoints are not linked to the WebsocketServlet and are unaware of the connected websocket clients. The endpoints URI /bar and /bar?sendToAll=true are treated as different endpoints, but belong to the same websocket. I created a fix and will make a PR for it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)