示例#1
0
 def call(self, data):
     if self.is_consuming:
         #self._correlation_id = str(uuid.uuid4())
         message = simplejson.dumps({'accountDBID': utils.getAccountDBID(), 'data': data})
         debug('[XMQP] call: %s' % utils.hide_guid(message))
         self._channel.basic_publish(
             exchange=self._exchange_name,
             routing_key='',
             #properties=pika.BasicProperties(
             #    reply_to=self._queue_name,
             #    correlation_id=self._correlation_id),
             body=message)
示例#2
0
 def call(self, data):
     if self.is_consuming:
         #self._correlation_id = str(uuid.uuid4())
         message = simplejson.dumps({'accountDBID': utils.getAccountDBID(), 'data': data})
         debug('[XMQP] call: %s' % utils.hide_guid(message))
         self._channel.basic_publish(
             exchange=self._exchange_name,
             routing_key='',
             #properties=pika.BasicProperties(
             #    reply_to=self._queue_name,
             #    correlation_id=self._correlation_id),
             body=message)
示例#3
0
 def get_exchange_name(self):
     debug('[XMQP] Getting exchange name')
     self._exchange_correlation_id = str(uuid.uuid4())
     message = simplejson.dumps({
         'token': config.token.token,
         'players': self._players,
         'capabilities': simplejson.dumps(getCapabilitiesData())})
     debug('[XMQP] %s' % utils.hide_guid(message))
     self._channel.basic_publish(
         exchange=XVM.XMQP_LOBBY_EXCHANGE,
         routing_key=XVM.XMQP_LOBBY_ROUTING_KEY,
         properties=pika.BasicProperties(
             reply_to=self._queue_name,
             correlation_id=self._exchange_correlation_id,
         ),
         body=message)
示例#4
0
 def call(self, data):
     if self.is_consuming and self._exchange_name is not None:
         try:
             #self._correlation_id = str(uuid.uuid4())
             message = simplejson.dumps({'accountDBID': utils.getAccountDBID(), 'data': data})
             debug('[XMQP] call: %s' % utils.hide_guid(message))
             self._channel.basic_publish(
                 exchange=self._exchange_name,
                 routing_key='',
                 #properties=pika.BasicProperties(
                 #    reply_to=self._queue_name,
                 #    correlation_id=self._correlation_id),
                 body=message)
         except Exception as ex:
             err('_exchange_name=' + str(self._exchange_name))
             err(traceback.format_exc())
示例#5
0
 def get_exchange_name(self):
     debug('[XMQP] Getting exchange name')
     self._exchange_correlation_id = str(uuid.uuid4())
     message = simplejson.dumps({
         'token': config.token.token,
         'players': self._players,
         'capabilities': simplejson.dumps(getCapabilitiesData())})
     debug('[XMQP] %s' % utils.hide_guid(message))
     self._channel.basic_publish(
         exchange=XVM.XMQP_LOBBY_EXCHANGE,
         routing_key=XVM.XMQP_LOBBY_ROUTING_KEY,
         properties=pika.BasicProperties(
             reply_to=self._queue_name,
             correlation_id=self._exchange_correlation_id,
         ),
         body=message)
示例#6
0
 def call(self, data):
     if self.is_consuming and self._exchange_name is not None:
         try:
             #self._correlation_id = str(uuid.uuid4())
             message = simplejson.dumps(
                 {
                     'accountDBID': utils.getAccountDBID(),
                     'data': data
                 },
                 separators=(',', ':'))
             debug('[XMQP] call: %s' % utils.hide_guid(message))
             self._channel.basic_publish(
                 exchange=self._exchange_name,
                 routing_key='',
                 #properties=pika.BasicProperties(
                 #    reply_to=self._queue_name,
                 #    correlation_id=self._correlation_id),
                 body=message)
         except Exception as ex:
             err('_exchange_name=' + str(self._exchange_name))
             err(traceback.format_exc())