avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Porter <gmpor...@gmail.com>
Subject How to define an RPC message with a void return type
Date Fri, 31 Jul 2009 21:54:00 GMT
Hi everyone,

I'm curious about how to define an RPC message with a void return
type.  For example, in this sample code for a simple key/value store:

{code}
{
  "namespace": "com.example",
  "protocol": "SimpleKV",

  "types": [
  ],

  "messages": {
    "get": {
      "request": [
        {
            "name": "key",
            "type" : "bytes"
        }
      ],
      "response": "bytes"
    },
    "put": {
      "request": [
        {
          "name": "key",
          "type": "bytes"
        },
        {
          "name": "value",
          "type": "bytes"
        }
      ],
      "response": "null"
    }
  }
}
{code}

The 'put' message gets compiled into the following signature in Java:

{code}
Void put(ByteBuffer key, ByteBuffer value)
    throws AvroRemoteException;
{code}

Unfortunately, Void isn't an instantiatable type in Java.  Any thoughts?

Thanks,
George

Mime
View raw message