Netflix / ribbon

Ribbon is a Inter Process Communication (remote procedure calls) library with built in software load balancers. The primary usage model involves REST calls with various serialization scheme support.
Apache License 2.0
4.55k stars 1.24k forks source link

Ribbon 2.0 entity handling #187

Open dstengle opened 9 years ago

dstengle commented 9 years ago

With the advent of ribbon 2.0, RestClient is now deprecated along with all of the convenient entity handling that it provided (after being listed as part of the 1.x roadmap and improvements in April. We're interested in the future, just pointing out the irony).

It appears that it could be possible to implement a generic JAXBContentTransformer / JacksonContentTransformer in order to get the request to handle the output transformation in a more generic way rather than writing a transformer class for every type.

What I can't see is any obvious way to handle the response. The ContentTransformer looks to be from the underlying rxnetty code and I don't see anything corresponding in the response objects to help with handling deserialization.

I realize that ribbon 2 is attempting to handle many different cases, but is there anything planned to try make this particular one easier to use?

dstengle commented 9 years ago

It feels as if this is possible. Looking at @stonse talk on microservices, the ribbon example shows ribbon returning a typed object when the client is generated from a service interface. The mechanics of this are not clear, though.

The RxMovieProxyExample.java just deals in ByteBuf. Is this just unreleased code?

I just found this burried in there:

            throw new ProxyAnnotationException(format("Method %s must return

RibbonRequest type not %s",

So it seems like the current implementation only allows working with ByteBuf.

jstockdi commented 9 years ago

@elandau - you seem to be making recent commits. Is there any chance you can review?

@allenxwang - thoughts?

elandau commented 9 years ago

We are currently working on the improvements you mention. A more robust entity mapping and serialization framework will be taken care of as a separate project under rxnetty.

jstockdi commented 9 years ago

Awesome! We wil use Func1 until then. Is there a rough ETA? We are excited.