Index: src/java/org/apache/avro/ipc/Responder.java =================================================================== --- src/java/org/apache/avro/ipc/Responder.java (revision 790269) +++ src/java/org/apache/avro/ipc/Responder.java (working copy) @@ -28,6 +28,8 @@ import org.apache.avro.*; import org.apache.avro.Protocol.Message; import org.apache.avro.util.*; +import org.apache.avro.generic.GenericDatumReader; +import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.io.*; import org.apache.avro.specific.*; @@ -39,6 +41,13 @@ = Collections.synchronizedMap(new WeakHashMap()); private Map protocols = Collections.synchronizedMap(new HashMap()); + + private static final Schema META = + Schema.createMap(Schema.create(Schema.Type.BYTES)); + private static final GenericDatumReader> META_READER = + new GenericDatumReader>(META); + private static final GenericDatumWriter> META_WRITER = + new GenericDatumWriter>(META); private Protocol local; private MD5 localHash; @@ -69,6 +78,7 @@ return bbo.getBufferList(); // read request using remote protocol specification + Map meta = META_READER.read(null, in); String messageName = in.readString(null).toString(); Message m = remote.getMessages().get(messageName); if (m == null) @@ -90,6 +100,7 @@ error = new AvroRemoteException(new Utf8(e.toString())); } + META_WRITER.write(meta, out); out.writeBoolean(error != null); if (error == null) writeResponse(m.getResponse(), response, out); Index: src/java/org/apache/avro/ipc/Requestor.java =================================================================== --- src/java/org/apache/avro/ipc/Requestor.java (revision 790269) +++ src/java/org/apache/avro/ipc/Requestor.java (working copy) @@ -29,6 +29,8 @@ import org.apache.avro.Protocol; import org.apache.avro.Schema; import org.apache.avro.Protocol.Message; +import org.apache.avro.generic.GenericDatumReader; +import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.io.Decoder; import org.apache.avro.io.Encoder; import org.apache.avro.io.BinaryEncoder; @@ -47,6 +49,13 @@ private Protocol remote; private boolean established, sendLocalText; private Transceiver transceiver; + + private static final Schema META = + Schema.createMap(Schema.create(Schema.Type.BYTES)); + private static final GenericDatumReader> META_READER = + new GenericDatumReader>(META); + private static final GenericDatumWriter> META_WRITER = + new GenericDatumWriter>(META); public Protocol getLocal() { return local; } public Protocol getRemote() { return remote; } @@ -63,6 +72,8 @@ throws IOException { Decoder in; Message m; + Map meta = + new HashMap(); // empty for now do { ByteBufferOutputStream bbo = new ByteBufferOutputStream(); Encoder out = new BinaryEncoder(bbo); @@ -75,6 +86,7 @@ if (m == null) throw new AvroRuntimeException("Not a local message: "+messageName); + META_WRITER.write(meta, out); out.writeString(m.getName()); // write message name writeRequest(m.getRequest(), request, out); // write request payload @@ -91,6 +103,7 @@ m = getRemote().getMessages().get(messageName); if (m == null) throw new AvroRuntimeException("Not a remote message: "+messageName); + meta = META_READER.read(null, in); if (!in.readBoolean()) { // no error return readResponse(m.getResponse(), in); } else {