code: function() {
          try {
            var server = {
              "host": params.host,
              "port": params.port,
              "timeout": params.timeout || 20000,
              "connectHeaders": {
                "host": "/",
                "login": params.username,
                "passcode": params.password,
                "heart-beat": "5000, 5000"
              }
            };
  
            var servers = [server];
  
            var reconnectOptions = {
              'maxReconnects': 20
            };
  
            var manager = new Stompit.ConnectFailover(servers, reconnectOptions);
  
            manager.connect(function(error, stompClient, reconnect) {
              if (error) {
                fireEvent("error", {
                  errorCode: error.code,
                  errorMessage: error.message,
                  errorEvent: error
                });
  
                return;
              }
  
              client = stompClient;
  
              client.on('error', function(error) {
                fireEvent("error", {
                  errorCode: 999,
                  errorMessage: "ActiveMQ client has had an error",
                  errorEvent: error
                });
                reconnect();
              });
  
              fireEvent("init");
            });
  
          } catch (error) {
            console.error(error);
          }
        }
docs: *****************************************************
  P R I V A T E   M E T H O D S            *
  *****************************************************