This repo is a playground for AMQP queues and LZ4 compression in C/Python.
Usage: ./consumer <queuename>
Usage: ./sender <queuename> <message> <type>
type : lz4/plain
Inspect queues with:
$ sudo rabbitmqctl list_queues
For C peers:
- rabbitmq-server
- librabbitmq1 (for envelopes etc.; only available in jessie)
- librabbitmq-dev
- liblz4-1 (for streams; only available in jessie)
- liblz4-dev
- libmongo-client-dev
For Python peers:
- python-lz4
- python-pika
A Python peer (sender/receiver) cannot communicate with a C peer (receiver/sender). That's because LZ4 compressed objects in Python have their size serialized in the header (4 bytes).
An example:
>>> import lz4
>>> a = lz4.compress("hello")
>>> len(a)
10
>>> str(a)
'\x05\x00\x00\x00Phello'
Funny, isn't it? :)