예제 #1
0
 async def stomp_send(self, topic, message):
     print('STOMP SEND topic=' + topic)
     frame = StompFrame()
     frame.set_command("SEND")
     frame.set_header('destination', topic)
     frame.set_content(message)
     out = StringIO()
     frame.write(out)
     await self.ws.send(out.getvalue().encode('utf-8'))
예제 #2
0
 async def stomp_send(self, topic, message):
     logger.debug('STOMP SEND topic=' + topic)
     frame = StompFrame()
     frame.set_command("SEND")
     frame.set_header('destination', topic)
     frame.set_header('content-length', str(len(message)))
     frame.set_content(message)
     out = StringIO()
     frame.write(out)
     await self.ws.send(out.getvalue().encode('utf-8'))
     logger.debug('stomp_send completed')