Commit 4a8348523adc7fafba302e91e88b7fd95f1476df

Authored by Jonathan Wilson
1 parent a7d17edceb
Exists in master and in 1 other branch dan

modified Dockerfile, requirements.txt

Showing 3 changed files with 13 additions and 9 deletions   Show diff stats
... ... @@ -3,6 +3,8 @@ FROM danzilla/centos6-python3-rabbit-worker
3 3 COPY . /opt/worker
4 4 WORKDIR /opt/worker
5 5  
  6 +RUN yum install -y libxml2-devel
  7 +RUN yum install -y libxslt-devel
6 8 RUN pip3.4 install -r requirements.txt
7 9  
8 10 CMD ["supervisord", "-n"]
9 11 \ No newline at end of file
... ...
... ... @@ -0,0 +1,2 @@
  1 +lxml
  2 +requests
0 3 \ No newline at end of file
... ...
... ... @@ -25,12 +25,12 @@ connection = pika.BlockingConnection(pika.ConnectionParameters(
25 25  
26 26 #Basic queue-declaring publisher code
27 27 channel = connection.channel()
28   -channel.queue_declare(queue='task_queue', durable=True)
  28 +channel.queue_declare(queue='jons_news', durable=True)
29 29  
30 30 message = "Hello world!"
31 31  
32 32 channel.basic_publish(exchange='',
33   - routing_key='task_queue',
  33 + routing_key='jons_news',
34 34 body=message,
35 35 properties=pika.BasicProperties(
36 36 delivery_mode = 2, # Make message persistent
... ... @@ -38,12 +38,12 @@ channel.basic_publish(exchange='',
38 38 logging.debug("Published: {0}".format(message))
39 39  
40 40 #Basic consumer code
41   -def callback(channel, method, properties, body):
42   - logging.debug("Received: {0}".format(body))
43   - channel.basic_ack(delivery_tag = method.delivery_tag)
  41 +# def callback(channel, method, properties, body):
  42 +# logging.debug("Received: {0}".format(body))
  43 +# channel.basic_ack(delivery_tag = method.delivery_tag)
44 44  
45   -channel.basic_qos(prefetch_count=1)
46   -channel.basic_consume(callback,
47   - queue='task_queue')
  45 +# channel.basic_qos(prefetch_count=1)
  46 +# channel.basic_consume(callback,
  47 +# queue='jons_news')
48 48  
49   -channel.start_consuming()
50 49 \ No newline at end of file
  50 +# channel.start_consuming()
51 51 \ No newline at end of file
... ...