flipkart-incubator / phantom

Phantom is a high performance proxy for accessing distributed services. It is an RPC system with support for different transports and protocols. Phantom is inspired by Twitter Finagle clients and builds on the capabilities of technologies like Netty, Unix Domain Sockets, Netflix Hystrix and Spring. Phantom proxies have been used to serve several hundred million API calls in production deployments at Flipkart.
49 stars 27 forks source link

Avoid serialization-deserialization in request params #61

Closed pmohankumar closed 8 years ago

pmohankumar commented 8 years ago

TaskContext and TaskHandler contracts require input parameters to be a Map < String, String >. So for applications running phantom in embedded mode with a HttpTaskHandler are forced to serialize request params like Headers into a String (which itself is generally a Map < String, String >) and then de-serialize it inside the task handler to read each header key-value and add them to actual http request. For high qps services with decent number of headers, this is becoming a bottle-neck. Applications should be able to pass URI, Method, Headers etc as they are (strings and maps) instead of converting all of them to string. Hence changing the request params to Map < String, Object >

pmohankumar commented 8 years ago

PLEASE DONT MERGE YET. This is a backward incompatible change and hence will have to upgrade version to 3.0.0. But there might be other fixes required as team is investigating another issue around locking in spring/trooper for event publishing flow.

amanhigh commented 8 years ago

Looks Good

shrey-garg commented 8 years ago

LGTM