thrift/contrib/zeromq
Roger Meier 49ff8b123a THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/'
To ensure there are no include path collisions the C and C++ header
include paths should include 'thrift' as the root leaf. This will
prevent having to place /usr/include/thrift into the compilers include
header search path, which might otherwise result in the compiler
accidentally picking up headers that it shouldn't.

e.g. #include <foo/bar.h> should be #include <thrift/foo/bar.h>

Change-Id: I48f2b0f549bda0fc81e85506ac857adc800b98a1

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1325674 13f79535-47bb-0310-9956-ffa450edef68
2012-04-13 09:12:31 +00:00
..
csharp THRIFT-812 Demo of Thrift over ZeroMQ (C#) 2011-04-19 19:47:03 +00:00
Makefile THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
README THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
storage.thrift THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
test-client.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
test-client.py THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
test-receiver.cpp THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
test-sender.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
test-server.cpp THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
test-server.py THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
TZmqClient.cpp THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
TZmqClient.h THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
TZmqClient.py THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00
TZmqServer.cpp THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
TZmqServer.h THRIFT-1552 Include paths for c/c++ should be prefixed with 'thrift/' 2012-04-13 09:12:31 +00:00
TZmqServer.py THRIFT-812. contrib: Add a demo of using Thrift over ZeroMQ 2010-08-31 16:58:41 +00:00

This directory contains some glue code to allow Thrift RPCs to be sent over
ZeroMQ.  Included are client and server implementations for Python and C++,
along with a simple demo interface (with a working client and server for
each language).

Thrift was designed for stream-based interfaces like TCP, but ZeroMQ is
message-based, so there is a small impedance mismatch.  Most of issues are
hidden from developers, but one cannot be: oneway methods have to be handled
differently from normal ones.  ZeroMQ requires the messaging pattern to be
declared at socket creation time, so an application cannot decide on a
message-by-message basis whether to send a reply.  Therefore, this
implementation makes it the client's responsibility to ensure that ZMQ_REQ
sockets are used for normal methods and ZMQ_DOWNSTREAM sockets are used for
oneway methods.  In addition, services that expose both types of methods
have to expose two servers (on two ports), but the TZmqMultiServer makes it
easy to run the two together in the same thread.

This code was tested with ZeroMQ 2.0.7 and pyzmq afabbb5b9bd3.

To build, simply install Thrift and ZeroMQ, then run "make".  If you install
in a non-standard location, make sure to set THRIFT to the location of the
Thrift code generator on the make command line and PKG_CONFIG_PATH to a path
that includes the pkgconfig files for both Thrift and ZeroMQ.  The test
servers take no arguments.  Run the test clients with no arguments to
retrieve the stored value or with an integer argument to increment it by
that amount.

This code is not quite what I would consider production-ready.  It doesn't
support all of the normal hooks into Thrift, and its performance is
sub-optimal because it does some unnecessary copying.