My little
zeromq plugin just hit drizzle trunk, it is simply a replication plugin that publishes a multi-frame message on a ZeroMQ endpoint. The first frame contains the name of the schema the transaction was executed against and the second frame is the actual protobuf-serialized transaction.
Getting started
- Install zeromq
- Build & install Drizzle (it will pick up the zeromq libs automatically)
- Start drizzled with --plugin-add=zeromq (this binds a zeromq socket on tcp://*:9999 - change this by setting --zeromq.endpoint=[whatever])
- Profit
Try it out by running this small python script:
import zmq
ctx = zmq.Context()
s = ctx.socket(zmq.SUB)
s.setsockopt(zmq.SUBSCRIBE, '')
s.connect('tcp://localhost:9999')
i = 0
while True:
i = i+1
print s.recv_multipart()
print i
You should see output on the form ['the_schema', *blob*].
0 comments:
Post a Comment