You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2016/09/27 06:34:20 UTC

[jira] [Resolved] (CAMEL-10342) WebSockets options are ignored

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

Claus Ibsen resolved CAMEL-10342.
---------------------------------
       Resolution: Fixed
         Assignee: Claus Ibsen
    Fix Version/s: 2.18.0

> WebSockets options are ignored
> ------------------------------
>
>                 Key: CAMEL-10342
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10342
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-websocket
>    Affects Versions: 2.16.3
>            Reporter: Daniel Beland
>            Assignee: Claus Ibsen
>             Fix For: 2.18.0
>
>
> Setting maxTextMessageSize or maxBinaryMessageSize has no effect, messages above the limit are still consumed and the route is started.
> I was debugging it to understand what was wrong and I came to the conclusion that parameters are set correctly on the camel WebSocketEndpoint and then on the ServletContextHandler (in camel method WebSocketComponent.setWebSocketComponentServletInitialParameter).
> But then the same values are null in jetty method WebSocketServlet.init() and they are not set on the WebSocketFactory.
> When I open a WebSocket connection I can see the default values are used instead of my settings in jetty WebSocketFactory.upgrade method.
> I think the problem is the init parameters that are set on the camel ServletContextHandler are not copied on the jetty ServletHolder.
> If I override the websocket bean in blueprint.xml with my own and override the createServlet method to copy the parameters then everything works correctly.
> So effectively changing the line in createServlet
> 	handler.addServlet(new ServletHolder(servlet), pathSpec);
> By
> 	ServletHolder servletHolder = new ServletHolder(servlet);
> 	servletHolder.setInitParameters(handler.getInitParams());
> 	handler.addServlet(servletHolder, pathSpec);
> Also I think the unit test WebscoketEndpointConfigurationTest.testSetServletInitalparameters is wrong, it simply verifies that the values are set in camel but never checks they are set correctly on the jetty side.



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