You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by haiyangzhou <zh...@gmail.com> on 2012/09/29 11:29:27 UTC

Re: Async Callbacks using Netty

avro just implements client-side async, not server-side async. am i right? 

my avro idl file is like this: 

protocol TestProtocol { 
    int hello(string msg); 
} 

so when i implements the generated interface TestProtocol.Callback, my own
implementation of hello(CharSequence, org.apache.avro.ipc.Callback<Integer>)
does not has any effect. only the sync method hello(CharSequence) is called. 

what i really want to do is described below. 

i want to implements a 'msg transmitter' using avro async protocol. 

an example request route is like this: client --> serverA --> serverB
-->serverC 

if the client invoke 'sendMsg("hello world")', then serverC will receive the
message ("hello world"). serverA & serverB just forward this request to the
next destination of the request route. 

i implements my own callback to accomplish this. callback of previous
request is kept until current callback returns. async method is used when
the request is forwarded to the next server. 

but when client invoke sendMsg(msg, callback), i could see sync method is
called on the serverA, but not the async one. and then no request forward
happens.



--
View this message in context: http://apache-avro.679487.n3.nabble.com/Async-Callbacks-using-Netty-tp3705392p4025338.html
Sent from the Avro - Users mailing list archive at Nabble.com.

Re: Async Callbacks using Netty

Posted by James Baldassari <jb...@gmail.com>.
Sorry for the long delay getting back to you on this.  You're correct that
Avro only supports async request handling on the client side currently, so
the behavior you're seeing makes sense.  On the server side only the
synchronous interface should be used.  It would be a great enhancement to
extend the async feature to the server/responder as well so that you could
chain messages in the way you've described.

-James


On Sat, Sep 29, 2012 at 5:29 AM, haiyangzhou <zh...@gmail.com> wrote:

> avro just implements client-side async, not server-side async. am i right?
>
> my avro idl file is like this:
>
> protocol TestProtocol {
>     int hello(string msg);
> }
>
> so when i implements the generated interface TestProtocol.Callback, my own
> implementation of hello(CharSequence,
> org.apache.avro.ipc.Callback<Integer>)
> does not has any effect. only the sync method hello(CharSequence) is
> called.
>
> what i really want to do is described below.
>
> i want to implements a 'msg transmitter' using avro async protocol.
>
> an example request route is like this: client --> serverA --> serverB
> -->serverC
>
> if the client invoke 'sendMsg("hello world")', then serverC will receive
> the
> message ("hello world"). serverA & serverB just forward this request to the
> next destination of the request route.
>
> i implements my own callback to accomplish this. callback of previous
> request is kept until current callback returns. async method is used when
> the request is forwarded to the next server.
>
> but when client invoke sendMsg(msg, callback), i could see sync method is
> called on the serverA, but not the async one. and then no request forward
> happens.
>
>
>
> --
> View this message in context:
> http://apache-avro.679487.n3.nabble.com/Async-Callbacks-using-Netty-tp3705392p4025338.html
> Sent from the Avro - Users mailing list archive at Nabble.com.
>