Skip to content

How to increase the Text message size  #27

@XuNeal

Description

@XuNeal

When I use the atmosphere and scalatra I got the MessageTooLargeException, I now the jetty limits the Text message size to 65k, Can I change this? and how?

here is some code of mine:
build.sbt

object build extends Build {
  val Organization = "com.xxx"
  val Name = "xxx"
  val Version = "0.2.0-SNAPSHOT"
  val ScalaVersion = "2.11.7"
  val ScalatraVersion = "2.4.0"
  val jettyVersion = "9.3.7.v20160115"

//  containerConfigFile := Some(file("resources/jetty.xml"))
//  containerLibs in Jetty := "org."
  javaOptions in Jetty += "-Dwebsocket.max.text.message.size=100000"

  lazy val project = Project (
    "xxx",
    file("."),
    settings = ScalatraPlugin.scalatraFullSettings ++ scalateSettings ++ Seq(
      organization := Organization,
      name := Name,
      version := Version,
      scalaVersion := ScalaVersion,
      resolvers += "Scalaz Bintray" at "http://dl.bintray.com/scalaz/releases",
      resolvers += Classpaths.typesafeReleases,
      libraryDependencies ++= Seq(
        "org.json4s"                  %% "json4s-jackson"      % "3.3.0",
        "org.scalatra"                %% "scalatra"            % ScalatraVersion,
        "org.scalatra"                %% "scalatra-scalate"    % ScalatraVersion,
        "org.scalatra"                %% "scalatra-specs2"     % ScalatraVersion  % "test",
        "org.scalatra"                %% "scalatra-atmosphere" % ScalatraVersion,
        "ch.qos.logback"              %  "logback-classic"     % "1.1.3"          % "runtime",
        "org.eclipse.jetty"           %  "jetty-plus"          % jettyVersion     % "container;provided",
        "org.eclipse.jetty"           %  "jetty-webapp"        % jettyVersion     % "container",
        "org.eclipse.jetty.websocket" %  "websocket-server"    % jettyVersion     % "container;provided",
        "javax.servlet"               %  "javax.servlet-api"   % "3.1.0"          % "container;provided;test"
      ),
      scalateTemplateConfig in Compile <<= (sourceDirectory in Compile){ base =>
        Seq(
          TemplateConfig(
            base / "webapp" / "WEB-INF" / "templates",
            Seq.empty,  /* default imports should be added here */
            Seq.empty,  /* add extra bindings here */
            Some("templates")
          )
        )
      }
    )

  ).enablePlugins(JettyPlugin)

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions