在两种不同的语言中使用相同的 Apache Thrift 服务器

Use the same Apache Thrift server in two different languages

可以为 Javascript web 和 Java 使用相同的 Apache Thrift 服务器吗?目前,我有一个用于 Javascript:

的 ThreadPoolServer
 TServer server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(processor));

以及 Java 的简单服务器:

TServer jserver = new TSimpleServer(new Args(jserverTransport).processor(jprocessor));

他们两个共享相同的信息。现在,我遇到了这样一个问题,有时其中一个客户端的数据不完整,我不知道是不是因为这个原因。

如果问题是,客户端是否可以使用任意支持 Thrift 的语言连接特定服务,那么答案是肯定的 YES 因为 that's what Thrift is all about

Now, i have this problem where somethimes the data comes incomplete in one of the clients and dont know if it's for that.

add the relevant information

  1. 什么客户端语言,
  2. Thrift protocol/transport 设置
  3. 代码的相关部分,最后一点
  4. 你遇到了什么错误(包括堆栈跟踪,如果有的话)

I forgot to say that im using an Http Server to connect to JavasScript. http://codeshare.io/llR5F Im not sure how to use it with the java client

Java HTP client 的工作方式应该与 JavaScript 客户端非常相似。 Thrift 库作为一个整体在各种语言之间非常一致,包括事物的工作方式和命名方式。