Пример #1
0
  @Override
  public void clientReceiveResponse(RPCContext context) {
    Assert.assertNotNull(context.responseCallMeta());
    Assert.assertNotNull(context.getRequestPayload());

    if (!context.responseCallMeta().containsKey(key)) return;

    ByteBuffer buf = context.responseCallMeta().get(key);
    Assert.assertNotNull(buf);
    Assert.assertNotNull(buf.array());

    String partialstr = new String(buf.array());
    Assert.assertNotNull(partialstr);
    Assert.assertEquals("partial string mismatch", "apac", partialstr);

    buf = ByteBuffer.wrap((partialstr + "he").getBytes());
    Assert.assertTrue(buf.remaining() > 0);
    context.responseCallMeta().put(key, buf);

    checkRPCMetaMap(context.responseCallMeta());
  }
Пример #2
0
 @Override
 public void serverSendResponse(RPCContext context) {
   exchangeHeadersToAvroHeaders(context.responseCallMeta());
 }