Compressing request content

148 views
Skip to first unread message

tc1

unread,
Sep 14, 2015, 12:20:23 PM9/14/15
to Gatling User Group

Hi

We want to see the effect of compressing the request data as we have large json payloads:

I tried the following code:

http("Create Account and Profile")
      .post("v3/accounts")
      .headers(Headers.Standard)
      .body(ELFileBody(getFilePath("full-account.json")))
      .processRequestBody(gzipBody)
      .check(status.is(201))
      .check(jsonPath("$.account.id").saveAs("accountId"))

But it failed to run with this error:

Exception in thread "main" java.lang.UnsupportedOperationException: requestCompressor doesn't support <function1>
        at io.gatling.http.request.BodyProcessors$$anonfun$1.apply(BodyProcessors.scala:35)
        at io.gatling.http.request.BodyProcessors$$anonfun$1.apply(BodyProcessors.scala:28)
        at scala.Option.map(Option.scala:146)
        at io.gatling.http.request.builder.HttpRequestBuilder.processRequestBody(HttpRequestBuilder.scala:89)
        at account.AccountRequests.createAccountAndProfile(AccountRequests.scala:62)
        at account.AccountRequests.<init>(AccountRequests.scala:21)
        at account.account.<init>(account.scala:35)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:379)
        at io.gatling.core.runner.Runner.run(Runner.scala:36)
        at io.gatling.app.Gatling$$anonfun$runSimulationIfNecessary$1.apply(Gatling.scala:138)
        at io.gatling.app.Gatling$$anonfun$runSimulationIfNecessary$1.apply(Gatling.scala:123)
        at scala.Option.getOrElse(Option.scala:121)
        at io.gatling.app.Gatling.runSimulationIfNecessary(Gatling.scala:123)
        at io.gatling.app.Gatling.start(Gatling.scala:73)
        at io.gatling.app.Gatling$.fromArgs(Gatling.scala:59)
        at io.gatling.app.Gatling$.main(Gatling.scala:44)
        at io.gatling.app.Gatling.main(Gatling.scala)

Any suggestions as to what I'm doing wrong?

tc1

unread,
Sep 15, 2015, 10:13:45 AM9/15/15
to Gatling User Group
version 2.1.7

João Rodrigues

unread,
Nov 25, 2015, 11:10:13 AM11/25/15
to Gatling User Group
Use something like this instead:
...
.body(StringBody(ELFileBodies.asString("
full-account.json")))
...

Stéphane LANDELLE

unread,
Nov 25, 2015, 12:22:40 PM11/25/15
to gat...@googlegroups.com
Indeed a bug: https://github.com/gatling/gatling/issues/2863
Thanks for reporting!

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages