~ubuntu-branches/ubuntu/trusty/drizzle/trusty-updates

« back to all changes in this revision

Viewing changes to plugin/zeromq/docs/index.rst

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2012-04-04 15:12:07 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120404151207-xwsgn1xegslle4p0
Tags: 1:7.1.32-rc-1
* New upstream release.
* Plugin-filtered-replicator upstream removed and will no longer be built.
* Updating d/*install files to accommodate upstream changes from drizzle7
  to drizzle
* Added symlink in libdrizzledmessage-dev to library
* libdrizzle: soname-bump
* Rename package drizzle-plugin-performance-dictionary to shorten package name
  (due to linitan warning package-has-long-file-name)
* Debian/control: removed unused substitution variable ${shlibs:Depends} for
  -dbg and -dev packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
ZeroMQ
4
4
======
5
5
 
6
 
ZeroMQ is a messaging library that allows you to easily build complex
7
 
communication systems. The ZeroMQ plugin allows drizzle to publish
8
 
transactions to a local PUB socket. Many clients can subscribe to
9
 
these transactions. The first frame of the message sent out is the
10
 
schema name the transaction touched - this enables clients to only
11
 
subscribe to the interesting schemas (note that certain "transactions"
12
 
are without a schema, like SET xyz for example, for these, the first
13
 
frame is empty).
14
 
 
15
 
Getting started
16
 
---------------
17
 
 
18
 
First, install zeromq, get the code from `zeromq.org
19
 
<http://zeromq.org>`_, then you can build drizzle, watch the
20
 
./configure output to verify that drizzle finds the libraries needed.
21
 
 
22
 
Now you are good to go, simply start drizzle with --plugin-add=zeromq
23
 
and drizzle will start publishing transactions. The only configuration
24
 
parameter available is:
25
 
 
26
 
.. code-block:: bash
27
 
 
28
 
  --zeromq.endpoint arg (=tcp://*:9999) - the endpoint to expose.
29
 
 
30
 
Now you can write a simple python script to verify that it works,
31
 
something like this will work:
32
 
 
33
 
.. code-block:: python
34
 
 
35
 
  import zmq
36
 
 
37
 
  ctx = zmq.Context()
38
 
  s = ctx.socket(zmq.SUB)
39
 
  s.setsockopt(zmq.SUBSCRIBE, '')
40
 
  s.connect('tcp://localhost:9999')
41
 
  i = 0
42
 
  while True:
43
 
      i = i+1
44
 
      s.recv_multipart()
45
 
      print i
46
 
 
47
 
and then you can generate some load:
48
 
 
49
 
.. code-block:: bash
50
 
 
51
 
  bin/drizzleslap -c 10 -a --auto-generate-sql-add-autoincrement --burnin
52
 
 
53
 
which creates 10 threads and generates random queries.
 
6
See :ref:`zeromq_applier`.