ActivemqMgr.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * 直播间男女端共用Manager
  3. */
  4. 'use strict';
  5. const F = require('../common/function');
  6. const C = require('../config');
  7. const _ = require('underscore');
  8. _.str = require('underscore.string');
  9. _.v = require('validator');
  10. const co = require('co');
  11. var Stomp = require('stomp-client');
  12. module.exports = function (app, commonManager) {
  13. let mgr_map = commonManager.mgr_map;
  14. let that = this;
  15. //this.client = new Stomp('172.17.13.235', 61613);
  16. //this.client = new Stomp('39.105.187.28', 61613);
  17. //this.client = new Stomp({
  18. // address: '39.105.187.28',
  19. // port: 61613,
  20. // user: '',
  21. // pass: '',
  22. // protocolVersion: '1.1',
  23. // vhost: null,
  24. // reconnectOpts: { retries: 100000000, delay: 500 }});
  25. //this.sessId = null;
  26. //this.client.connect(function(sessionId) {
  27. // that.sessId = sessionId;
  28. // that.client.subscribe("/queue/test_delay_queue",function(body, headers) {
  29. // F.addDebugLogs(["/queue/test_delay_queue recv: pre"]);
  30. // F.addDebugLogs(["/queue/test_delay_queue recv:",body,headers]);
  31. // });
  32. // //client.subscribe(destination, function(body, headers) {
  33. // // console.log('From MQ:', body);
  34. // //});
  35. // //client.publish(destination, 'Hello World!');
  36. //});
  37. //var deasync = require('deasync');
  38. //while (true) {
  39. // if (null != this.sessId) break;
  40. // console.log("waiting for active connect.");
  41. // deasync.sleep(200);
  42. //}
  43. //console.log("active connect suc.");
  44. };