code: static void subscribeIfNotDone() {
          Enumeration<String > callbackKeys = failed_event_callback_map.keys();
          while (callbackKeys.hasMoreElements()) {
              String callbackKey = callbackKeys.nextElement();
              EventCallBackStruct eventCallBackStruct = failed_event_callback_map.get(callbackKey);
              if (eventCallBackStruct.consumer!=null) {
                  try {
                      subscribeIfNotDone(eventCallBackStruct, callbackKey);
                  } catch (DevFailed e) {
                      //	Send error to callback
                      sendErrorToCallback(eventCallBackStruct, callbackKey, e);
                  }
              }
              else {
                  if (EventConsumerUtil.isZmqLoadable()) {
                      try {
                          //  Try for zmq
                          eventCallBackStruct.consumer = ZmqEventConsumer.getInstance();
                          subscribeIfNotDone(eventCallBackStruct, callbackKey);
                          return;
  
                      }
                      catch (DevFailed e) {
                          if (e.errors[0].desc.equals(ZMQutils.SUBSCRIBE_COMMAND_NOT_FOUND)) {
                              try {
                                  //  Try for notifd
                                  eventCallBackStruct.consumer = NotifdEventConsumer.getInstance();
                                  subscribeIfNotDone(eventCallBackStruct, callbackKey);
                                  return;
                              }
                              catch (DevFailed e2) {
  								//TODO use DevFailedUtils#printDevFailed from JTangoCommons
                                 System.err.println(e2.errors[0].desc);
                                  //  reset if both have failed
                                  eventCallBackStruct.consumer = null;
                                  //	Send error to callback
                                  sendErrorToCallback(eventCallBackStruct, callbackKey, e2);
                              }
                          }
                          else {
                              //	Send error to callback
                              eventCallBackStruct.consumer = null;
                              sendErrorToCallback(eventCallBackStruct, callbackKey, e);
                          }
                      }
                  }
                  else
                  {
                      try {
                          //  Try for notifd
                          eventCallBackStruct.consumer = NotifdEventConsumer.getInstance();
                          subscribeIfNotDone(eventCallBackStruct, callbackKey);
                          return;
                      }
                      catch (DevFailed e) {
  						//TODO use DevFailedUtils#printDevFailed from JTangoCommons
                          System.err.println(e.errors[0].desc);
                          //	Send error to callback
                          sendErrorToCallback(eventCallBackStruct, callbackKey, e);
                      }
                  }
              }
          }
      }
docs: ===============================================================