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