source: trunk/Monitoring/test/librabbitmq-python/test2/producer.py @ 963

Last change on this file since 963 was 854, checked in by jripsl, 11 years ago

add JSON deserialization, mail notification, logging.

  • Property svn:executable set to *
File size: 756 bytes
Line 
1#!/bin/env python
2import amqplib.client_0_8 as amqp
3
4# Connect
5connection = amqp.Connection( host = "localhost:5672", 
6                              userid = "guest", 
7                              password = "guest", 
8                              virtual_host = "/", 
9                              insist = False )
10
11# Create our channel
12channel = connection.channel()
13
14""" We've already declared our queue, exchange and binding in our consumer so just send the messages """
15for i in range(0, 10):
16        message = amqp.Message("Test message %i!" % i)
17        message.properties["delivery_mode"] = 2
18        channel.basic_publish( message, 
19                               exchange = "test", 
20                               routing_key = "test.messages")
Note: See TracBrowser for help on using the repository browser.