Chunked Encoding Response Check (Chunk Response Handler)

423 views
Skip to first unread message

ypo...@twitter.com

unread,
Aug 9, 2016, 1:45:54 PM8/9/16
to Gatling User Group
Hello,

Running into a use case that I'm having a hard time finding info for. I'm currently interacting with a system that returns a chunked transfer response when a GET is performed:

* Connected to localhost (::1) port 8080 (#0)
> GET <url> HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.43.0
> Accept: */*

HTTP/1.1 200 OK
Content-Type: application/json
Content-Disposition: attachment; filename=json.json
Pragma: no-cache
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Server: <Server>
Date: Tue, 09 Aug 2016 17:37:21 GMT
Transfer-Encoding: chunked

Each chunk then contains a message that is being streamed. Gatling doesn't currently seem to run checks until a response is fully received, which never happens since the connection is kept open for streaming. Is there something that I can do so that I can check the body as a chunk arrives?

Thanks

ypo...@twitter.com

unread,
Aug 9, 2016, 2:03:43 PM8/9/16
to Gatling User Group
this is with the latest stable, 2.2.2

Stéphane LANDELLE

unread,
Aug 9, 2016, 2:39:00 PM8/9/16
to gat...@googlegroups.com
Well, we do support Server Sent Events, which looks VERY similar to what you're doing.

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ypo...@twitter.com

unread,
Aug 9, 2016, 2:43:42 PM8/9/16
to Gatling User Group
Oh wow thanks, I didn't realize that was the purpose. Let me try using that and get back to you on the result. Thanks again!
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.

Stéphane LANDELLE

unread,
Aug 9, 2016, 2:56:53 PM8/9/16
to gat...@googlegroups.com
Beware that SSE chunks must comply with the spec.
If you've implemented your own custom protocol, you'll be stuck. But then, the question would be: why not stick to a standard such as SSE or WebSocket?

Stéphane Landelle
GatlingCorp CEO


To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.

ypo...@twitter.com

unread,
Aug 10, 2016, 11:59:54 AM8/10/16
to Gatling User Group
It is a custom protocol, but it seems to be very close to the sse spec, I was able to parse messages with that. Json was broken due to not being in spec, but the raw regex worked great. Thanks for the help.
Reply all
Reply to author
Forward
0 new messages