Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
3f57da61
Commit
3f57da61
authored
Mar 13, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added code to test
parent
72aa1b61
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
plannerInput2.json
doc/json_samples/plannerInput2.json
+1
-0
DRIPCaller.java
...api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java
+4
-0
rpc_server.py
drip-planner/rpc_server.py
+12
-7
No files found.
doc/json_samples/plannerInput2.json
0 → 100644
View file @
3f57da61
This diff is collapsed.
Click to expand it.
drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java
View file @
3f57da61
...
...
@@ -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
);
}
...
...
drip-planner/rpc_server.py
View file @
3f57da61
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment