Skip to content

Commit

Permalink
rref #5367
Browse files Browse the repository at this point in the history
rref #5366
ref #66
ref #65
  • Loading branch information
evrenesat committed Jun 28, 2016
1 parent 0c17f7a commit b3f8e53
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions zengine/client_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ def get_sess_id(self):
return self.sess_id

def send_to_queue(self, message=None, json_message=None):
log.debug("Sending following message to %s queue:\n%s " % (
self.sess_id, json_message or json.dumps(message)))
self.get_channel().publish(exchange=self.user_id or '',
exchange = self.user_id or ''
log.debug("Sending following message to %s queue, \"%s\" exchange:\n%s " % (
self.sess_id, exchange, json_message or json.dumps(message)))

self.get_channel().publish(exchange=exchange,
routing_key=self.sess_id,
body=json_message or json.dumps(message))

Expand Down
3 changes: 2 additions & 1 deletion zengine/messaging/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def get_role(self, role_id):
def full_name(self):
return self.username

def bind_private_channel(self, sess_id):
@classmethod
def bind_private_channel(cls, sess_id):
mq_channel = self._connect_mq()
mq_channel.queue_bind(exchange='prv_%s' % self.key, queue=sess_id)

Expand Down
4 changes: 2 additions & 2 deletions zengine/tornado_server/queue_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ def register_websocket(self, sess_id, ws):
def inform_disconnection(self, sess_id):
self.in_channel.basic_publish(exchange='input_exc',
routing_key=sess_id,
body=json_encode({
body=json_encode(dict(data={
'view': 'mark_offline_user',
'sess_id': sess_id
}))
})))

def unregister_websocket(self, sess_id):
try:
Expand Down
2 changes: 1 addition & 1 deletion zengine/wf_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def handle_message(self, ch, method, properties, body):
raise
err = traceback.format_exc()
output = {'error': self._prepare_error_msg(err), "code": 500}
log.exception("Worker error occurred")
log.exception("Worker error occurred with messsage body:\n%s" % body)
if 'callbackID' in input:
output['callbackID'] = input['callbackID']
log.info("OUTPUT for %s: %s" % (sessid, output))
Expand Down

0 comments on commit b3f8e53

Please sign in to comment.