[
https://issues.apache.org/jira/browse/CAMEL-10342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15524085#comment-15524085
]
ASF GitHub Bot commented on CAMEL-10342:
----------------------------------------
GitHub user dcendents opened a pull request:
https://github.com/apache/camel/pull/1187
CAMEL-10342: correctly set the web socket parameters
Fixes https://issues.apache.org/jira/browse/CAMEL-10342
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dcendents/camel websocket_parameters
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1187.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 #1187
----
commit 97476b994009852df5af9d1a8c6d0f537f074004
Author: Daniel Beland <[email protected]>
Date: 2016-09-26T20:19:37Z
CAMEL-10342: correctly set the web socket parameters from the endpoint uri
----
> 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
>
> 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)