Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> asynchronous server


+
Peter S 2012-02-26, 23:24
Copy link to this message
-
Re: asynchronous server
Hi Peter,

Yes, there is support in Avro for asynchronous RPCs, but it's currently
limited to Java and the Netty client/server implementation.  This was
implemented in AVRO-539 and first released in Avro 1.5.2.

Asynchronous RPCs are implemented using the Callback interface.  When Avro
generates the Java interface for your protocol in v1.5.2 or later you'll
see a sub-interface called Callback.  For example, if your protocol is
called Mail, you'll have a Java interface called Mail and a sub-interface
Mail.Callback which extends Mail and adds the callback-enabled RPCs.  This
is the interface you should use on the client side (when you create a
SpecificRequestor).  On the server side, nothing changes to enable
asynchronous RPCs.  The server (SpecificResponder) will implement Mail.

I would suggest taking a look at some examples to get started.  A good
place to start would be the Avro unit tests for the Callback APIs:

http://svn.apache.org/viewvc/avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/ipc/TestNettyServerWithCallbacks.java?view=markup

I also created a github project to demonstrate a real-world use case for
async RPCs using a real-time online auction:

https://github.com/jbaldassari/Avro-RPC

Also see this recent Avro users thread which has some pointers about
callbacks:

http://search-hadoop.com/m/HDNLxeVRbO

Hopefully that will get you started, but please write back if you have any
problems getting it working.

-James
On Sun, Feb 26, 2012 at 6:24 PM, Peter S <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I am new to avro. I am trying to writing an asynchronous server which will
> make other RPC calls. So I am wondering how can I do this. I found a
> related jira issue:
> https://issues.apache.org/jira/browse/AVRO-405
>
> But it seems only #1 is solved. Does Avro support #2 in this ticket now?
> Thanks!
>
> Regards,
> Peter
>
+
Peter S 2012-02-27, 01:02
+
James Baldassari 2012-02-27, 01:52
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB