You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mp...@apache.org on 2018/06/06 15:57:06 UTC

[ambari] branch trunk updated: AMBARI-24043. Increase outbound message buffer size. (mpapirkovskyy) (#1478)

This is an automated email from the ASF dual-hosted git repository.

mpapirkovskyy pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 17d1d4f  AMBARI-24043. Increase outbound message buffer size. (mpapirkovskyy) (#1478)
17d1d4f is described below

commit 17d1d4fb6db27520487fb2de49bd6e34cde2b1bb
Author: Myroslav Papirkovskyi <mp...@apache.org>
AuthorDate: Wed Jun 6 18:57:01 2018 +0300

    AMBARI-24043. Increase outbound message buffer size. (mpapirkovskyy) (#1478)
---
 .../ambari/server/configuration/Configuration.java | 26 +++++++++++++++++-----
 .../configuration/spring/AgentStompConfig.java     |  5 +++--
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index cc0042f..241edc2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -1862,13 +1862,20 @@ public class Configuration {
       "api.heartbeat.interval", 10000);
 
   /**
-   * The maximum size of a stomp text message. Default is 2 MB.
+   * The maximum size of an incoming stomp text message. Default is 2 MB.
    */
-  @Markdown(description = "The maximum size of a stomp text message. Default is 2 MB.")
-  public static final ConfigurationProperty<Integer> STOMP_MAX_MESSAGE_SIZE = new ConfigurationProperty<>(
+  @Markdown(description = "The maximum size of an incoming stomp text message. Default is 2 MB.")
+  public static final ConfigurationProperty<Integer> STOMP_MAX_INCOMING_MESSAGE_SIZE = new ConfigurationProperty<>(
       "stomp.max.message.size", 2*1024*1024);
 
   /**
+   * The maximum size of a buffer for stomp message sending. Default is 5 MB.
+   */
+  @Markdown(description = "The maximum size of a buffer for stomp message sending. Default is 5 MB.")
+  public static final ConfigurationProperty<Integer> STOMP_MAX_BUFFER_MESSAGE_SIZE = new ConfigurationProperty<>(
+      "stomp.max.message.size", 5*1024*1024);
+
+  /**
    * The maximum number of threads used to extract Ambari Views when Ambari
    * Server is starting up.
    */
@@ -4577,10 +4584,17 @@ public class Configuration {
   }
 
   /**
-   * @return the maximum size of a stomp text message. Default is 2 MB.
+   * @return the maximum size of an incoming stomp text message. Default is 2 MB.
+   */
+  public int getStompMaxIncomingMessageSize() {
+    return Integer.parseInt(getProperty(STOMP_MAX_INCOMING_MESSAGE_SIZE));
+  }
+
+  /**
+   * @return the maximum size of a buffer for stomp message sending. Default is 5 MB.
    */
-  public int getStompMaxMessageSize() {
-    return Integer.parseInt(getProperty(STOMP_MAX_MESSAGE_SIZE));
+  public int getStompMaxBufferMessageSize() {
+    return Integer.parseInt(getProperty(STOMP_MAX_BUFFER_MESSAGE_SIZE));
   }
 
   /**
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/AgentStompConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/AgentStompConfig.java
index 9e8be7c..7084e8f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/AgentStompConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/AgentStompConfig.java
@@ -55,7 +55,7 @@ public class AgentStompConfig extends AbstractWebSocketMessageBrokerConfigurer {
 
   public DefaultHandshakeHandler getHandshakeHandler() {
     WebSocketServerFactory webSocketServerFactory = new WebSocketServerFactory(servletContext);
-    webSocketServerFactory.getPolicy().setMaxTextMessageSize(configuration.getStompMaxMessageSize());
+    webSocketServerFactory.getPolicy().setMaxTextMessageSize(configuration.getStompMaxIncomingMessageSize());
 
     return new DefaultHandshakeHandler(
         new JettyRequestUpgradeStrategy(webSocketServerFactory));
@@ -81,6 +81,7 @@ public class AgentStompConfig extends AbstractWebSocketMessageBrokerConfigurer {
 
   @Override
   public void configureWebSocketTransport(WebSocketTransportRegistration registration) {
-    registration.setMessageSizeLimit(configuration.getStompMaxMessageSize());
+    registration.setMessageSizeLimit(configuration.getStompMaxIncomingMessageSize());
+    registration.setSendBufferSizeLimit(configuration.getStompMaxBufferMessageSize());
   }
 }

-- 
To stop receiving notification emails like this one, please contact
mpapirkovskyy@apache.org.