Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase the Text message size #27

Open
XuNeal opened this issue Mar 15, 2016 · 0 comments
Open

How to increase the Text message size #27

XuNeal opened this issue Mar 15, 2016 · 0 comments

Comments

@XuNeal
Copy link

XuNeal commented Mar 15, 2016

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)

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant