code: private void connect(DeviceProxy deviceProxy, String attributeName,
                           String eventName, DeviceData deviceData) throws DevFailed {
          String deviceName = deviceProxy.fullName();
          int tangoVersion = deviceData.extractLongStringArray().lvalue[0];
          try {
              String adminName = deviceProxy.adm_name();  //.toLowerCase();
              //  Since Tango 8.1, heartbeat is sent in lower case.
              //tangoVersion = new DeviceProxy(adm_name).getTangoVersion();
              if (tangoVersion>=810)
                  adminName = adminName.toLowerCase();
  
              // If no connection exists to this channel, create it
              Database database = null;
              if (!channel_map.containsKey(adminName)) {
                  if (deviceProxy.use_db())
                      database = deviceProxy.get_db_obj();
                  ConnectionStructure connectionStructure =
                          new ConnectionStructure(deviceProxy.get_tango_host(),
                                  adminName, deviceName, attributeName,
                                  eventName, database, deviceData, false);
                  connect_event_channel(connectionStructure);
              } else if (deviceProxy.use_db()) {
                  database = deviceProxy.get_db_obj();
                  ZMQutils.connectEvent(deviceProxy.get_tango_host(), deviceName,
                          attributeName, deviceData.extractLongStringArray(), eventName,false);
              }
              EventChannelStruct eventChannelStruct = channel_map.get(adminName);
              eventChannelStruct.adm_device_proxy =  new DeviceProxy(adminName);
              eventChannelStruct.use_db = deviceProxy.use_db();
              eventChannelStruct.dbase = database;
              eventChannelStruct.setTangoRelease(tangoVersion);
  
              device_channel_map.put(deviceName, adminName);
          }
          catch (DevFailed e) {
              Except.throw_event_system_failed("API_BadConfigurationProperty",
                      "Can't subscribe to event for device " + deviceName
                              + "\n Check that device server is running...",
                      "ZmqEventConsumer.connect");
          }
      }
docs: ===============================================================