activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1374226 - /activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
Date Fri, 17 Aug 2012 12:44:42 GMT
Author: dejanb
Date: Fri Aug 17 12:44:42 2012
New Revision: 1374226

URL: http://svn.apache.org/viewvc?rev=1374226&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3980 - websockets increase max size of text message

Modified:
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java?rev=1374226&r1=1374225&r2=1374226&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
Fri Aug 17 12:44:42 2012
@@ -22,6 +22,7 @@ import org.apache.activemq.transport.Soc
 import org.apache.activemq.transport.TransportServerSupport;
 import org.apache.activemq.transport.WebTransportServerSupport;
 import org.apache.activemq.util.InetAddressUtil;
+import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.ServiceStopper;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
@@ -40,6 +41,8 @@ import java.util.Map;
  */
 public class WSTransportServer extends WebTransportServerSupport {
 
+    int maxTextMessageSize = -1;
+
     public WSTransportServer(URI location) {
         super(location);
         this.bindAddress = location;
@@ -61,6 +64,9 @@ public class WSTransportServer extends W
                 new ServletContextHandler(server, "/", ServletContextHandler.NO_SECURITY);
 
         ServletHolder holder = new ServletHolder();
+        if (maxTextMessageSize != -1) {
+            holder.setInitParameter("maxTextMessageSize", String.valueOf(maxTextMessageSize));
+        }
         holder.setServlet(new StompServlet());
         contextHandler.addServlet(holder, "/");
 
@@ -91,8 +97,16 @@ public class WSTransportServer extends W
 
     @Override
     public void setTransportOption(Map<String, Object> transportOptions) {
+        IntrospectionSupport.setProperties(this, transportOptions);
         socketConnectorFactory.setTransportOptions(transportOptions);
         super.setTransportOption(transportOptions);
     }
 
+    public int getMaxTextMessageSize() {
+        return maxTextMessageSize;
+    }
+
+    public void setMaxTextMessageSize(int maxTextMessageSize) {
+        this.maxTextMessageSize = maxTextMessageSize;
+    }
 }



Mime
View raw message