Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
UNI-KLU
SMART
Commits
ee789e29
Commit
ee789e29
authored
Aug 20, 2019
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for MessageSender Error
parent
d6ec9dd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
MessageHandler.py
...ntic-linking-microservice/app/messaging/MessageHandler.py
+1
-1
blockchain_trace.py
rest-gateway/app/rest/blockchain_trace.py
+9
-3
No files found.
data-hub/semantic-linking-microservice/app/messaging/MessageHandler.py
View file @
ee789e29
...
...
@@ -39,4 +39,4 @@ class MessageHandler:
traces
=
response
.
json
()
self
.
_processor
.
process
(
traces
)
else
:
LOGGER
.
error
(
f
"Could not retrieve JSON from {url} with GET request"
)
LOGGER
.
error
(
f
"Could not retrieve JSON from {url} with GET request
({response.status_code})
"
)
rest-gateway/app/rest/blockchain_trace.py
View file @
ee789e29
...
...
@@ -2,16 +2,22 @@ from flask import request, Response
from
messaging.MessageSender
import
MessageSender
import
json
message_sender
=
MessageSender
()
message_sender
.
connect
()
message_sender
.
create_exchange
(
'inhub'
,
'direct'
)
def
receive
():
body
=
request
.
json
if
isBlockchainTraceValid
(
body
):
# TODO remove workaround
message_sender
=
MessageSender
()
message_sender
.
connect
()
message_sender
.
create_exchange
(
'inhub'
,
'direct'
)
message
=
{
'type'
:
'blockchain-transaction'
,
'content'
:
body
}
message_sender
.
send
(
'inhub'
,
json
.
dumps
(
message
),
'trace-retrieval'
)
message_sender
.
disconnect
()
return
Response
(
status
=
201
)
return
Response
(
status
=
400
)
...
...
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