eBay / parallec

Fast Parallel Async HTTP/SSH/TCP/UDP/Ping Client Java Library. Aggregate 100,000 APIs & send anywhere in 20 lines of code. Ping/HTTP Calls 8000 servers in 12 seconds. (Akka) www.parallec.io
Apache License 2.0
805 stars 173 forks source link

ParallelClient responseContent enconding #46

Closed jeffpeiyt closed 7 years ago

jeffpeiyt commented 7 years ago

Issue raised in https://groups.google.com/forum/#!topic/parallec/MB2QyGGnwTk

Need to add a parameter in http meta to get the response body with the proper encoding.

public String getResponseBody(String charset) throws IOException; response.getResponseBody("UTF-8")

jeffpeiyt commented 7 years ago

Customer indicates he is working on patching this. Close it for now and may reopen it if need further action

ghost commented 7 years ago

Any news on this issue? Encoding bug makes parallec unusable for production.

jeffpeiyt commented 7 years ago

@devnewton busy recently but should get it in 1 week. It is better to pass a parameter per task but setting a global one from https://github.com/eBay/parallec/blob/master/src/main/java/io/parallec/core/config/ParallecGlobalConfig.java would be super easy. (and you can overwrite any values very easily before calling parallec) http://www.parallec.io/docs/configurations/

https://asynchttpclient.github.io/async-http-client/apidocs/com/ning/http/client/Response.html#getResponseBody(java.lang.String)

Need to add a parameter in http meta to get the response body with the proper encoding.

public String getResponseBody(String charset) throws IOException; response.getResponseBody("UTF-8")

Do you currently have tasks where each response needs different encodings?

jeffpeiyt commented 7 years ago

@devnewton please check tests on none-unicode websites:

https://github.com/eBay/parallec/blob/930fc4d897cd4cc414799af917b9dafb8ccaf70a/src/test/java/io/parallec/core/main/http/ParallelClientHttpBasicMoreOptionsTest.java#L119

https://github.com/eBay/parallec/blob/master/CHANGELOG.md#version-0106

ghost commented 7 years ago

Thanks!

jeffpeiyt commented 7 years ago

Released 0.10.6