0

I have generated client and server. I need to add one more field to message in client and read it in server. I think about to decorate TProtocol on client side and TProcessor on server side. E.g.:

// Client:
TTransport transport = new TSocket("localhost", 8888);
transport.open();
TProtocol protocol = new DecoratedProtocol(new TBinaryProtocol(transport));

// Server:
 TServerTransport transport = new TServerSocket(8888);
 TServer server = new TSimpleServer(new Args(transport).processor(new DecoratedProcessor(...)));

But I'm not sure what to do inside DecoratedProtocol and DecoratedProcessor?

smalafeev
  • 147
  • 3
  • 10

1 Answers1

0

There is a solution to add message meta data called the THeaderProtocol, but AFAIK right now this is only implemented for C++. That could be a starting point to implement the same for Java.

EDIT: I just noticed that fbthrift seems to implement THeaderProtocol for Java already.

JensG
  • 13,148
  • 4
  • 45
  • 55