Commit 3f57da61 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added code to test

parent 72aa1b61
This diff is collapsed.
......@@ -8,6 +8,7 @@ import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import com.sun.xml.internal.fastinfoset.tools.StAX2SAXReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
......@@ -130,6 +131,9 @@ public abstract class DRIPCaller implements AutoCloseable {
return Converter.string2Message(clean);
}
Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Got: {0}", clean);
return mapper.readValue(clean, Message.class);
}
......
......@@ -17,9 +17,9 @@ import json
connection = pika.BlockingConnection(pika.ConnectionParameters(host='127.0.0.1'))
channel = connection.channel()
channel.queue_declare(queue='planner_queue')
#connection = pika.BlockingConnection(pika.ConnectionParameters(host='127.0.0.1'))
#channel = connection.channel()
#channel.queue_declare(queue='planner_queue')
......@@ -145,8 +145,13 @@ def on_request(ch, method, props, body):
body=str(response))
ch.basic_ack(delivery_tag = method.delivery_tag)
channel.basic_qos(prefetch_count=1)
channel.basic_consume(on_request, queue='planner_queue')
#channel.basic_qos(prefetch_count=1)
#channel.basic_consume(on_request, queue='planner_queue')
#print(" [x] Awaiting RPC requests")
#channel.start_consuming()
f = open("../doc/json_samples/plannerInput2.json","r")
body=f.read()
response = handleDelivery(body)
print(" [x] Awaiting RPC requests")
channel.start_consuming()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment