-
Notifications
You must be signed in to change notification settings - Fork 215
/
test_table_encoding.py
40 lines (31 loc) · 1006 Bytes
/
test_table_encoding.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
'''
Example of simple producer, creates one message and exits.
'''
import pika
import sys
import time
if __name__ == '__main__':
connection = pika.BlockingConnection(pika.ConnectionParameters(
'127.0.0.1',
credentials=pika.PlainCredentials('guest', 'guest')))
channel = connection.channel()
r = channel.queue_declare(arguments={'x-expires':10000L})
h = {
'a': 'a',
'b': 1,
'c': -1,
'd': 4611686018427387904L,
'e': -4611686018427387904L,
'f': [1,2,3],
'g': [1,2,3,[1,2,3]],
}
channel.basic_publish(exchange='',
routing_key=r.queue,
body='test',
properties=pika.BasicProperties(headers=h))
channel.close()
channel = connection.channel()
a = channel.basic_get(queue=r.queue, no_ack=True)
print repr(h)
print repr(a._properties.headers)