3
ZeroMQ is a messaging library that allows you to easily build complex
4
communication systems. The ZeroMQ plugin allows drizzle to publish
5
transactions to a local PUB socket. Many clients can subscribe to
6
these transactions. The first frame of the message sent out is the
7
schema name the transaction touched - this enables clients to only
8
subscribe to the interesting schemas (note that certain "transactions"
9
are without a schema, like SET xyz for example, for these, the first
14
First, install zeromq, get the code from `zeromq.org
15
<http://zeromq.org>`_, then you can build drizzle, watch the
16
./configure output to verify that drizzle finds the libraries needed.
18
Now you are good to go, simply start drizzle with --plugin-add=zeromq
19
and drizzle will start publishing transactions. The only configuration
20
parameter available is:
24
--zeromq.endpoint arg (=tcp://*:9999) - the endpoint to expose.
26
Now you can write a simple python script to verify that it works,
27
something like this will work:
29
.. code-block:: python
34
s = ctx.socket(zmq.SUB)
35
s.setsockopt(zmq.SUBSCRIBE, '')
36
s.connect('tcp://localhost:9999')
43
and then you can generate some load:
47
bin/drizzleslap -c 10 -a --auto-generate-sql-add-autoincrement --burnin
49
which creates 10 threads and generates random queries.