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; ...@@ -8,6 +8,7 @@ import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope; import com.rabbitmq.client.Envelope;
import com.sun.xml.internal.fastinfoset.tools.StAX2SAXReader;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -130,6 +131,9 @@ public abstract class DRIPCaller implements AutoCloseable { ...@@ -130,6 +131,9 @@ public abstract class DRIPCaller implements AutoCloseable {
return Converter.string2Message(clean); return Converter.string2Message(clean);
} }
Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Got: {0}", clean); Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Got: {0}", clean);
return mapper.readValue(clean, Message.class); return mapper.readValue(clean, Message.class);
} }
......
...@@ -17,9 +17,9 @@ import json ...@@ -17,9 +17,9 @@ import json
connection = pika.BlockingConnection(pika.ConnectionParameters(host='127.0.0.1')) #connection = pika.BlockingConnection(pika.ConnectionParameters(host='127.0.0.1'))
channel = connection.channel() #channel = connection.channel()
channel.queue_declare(queue='planner_queue') #channel.queue_declare(queue='planner_queue')
...@@ -145,8 +145,13 @@ def on_request(ch, method, props, body): ...@@ -145,8 +145,13 @@ def on_request(ch, method, props, body):
body=str(response)) body=str(response))
ch.basic_ack(delivery_tag = method.delivery_tag) ch.basic_ack(delivery_tag = method.delivery_tag)
channel.basic_qos(prefetch_count=1) #channel.basic_qos(prefetch_count=1)
channel.basic_consume(on_request, queue='planner_queue') #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