code: private void connect(DeviceProxy device_proxy, String attributeName, String eventName, DeviceData deviceData) throws DevFailed {
          String deviceName = device_proxy.name();
          String adm_name = null;
          try {
              adm_name = device_proxy.adm_name();
          } 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...",
                      "NotifdEventConsumer.connect");
          }
          String channelName = adm_name;
          // If no connection exists to this channel, create it
          Database dbase = null;
          if (!channel_map.containsKey(channelName)) {
              if (device_proxy.use_db())
                  dbase = device_proxy.get_db_obj();
              ConnectionStructure connectionStructure =
                      new ConnectionStructure(device_proxy.get_tango_host(), channelName,
                          deviceName, attributeName, eventName, dbase, deviceData, false);
              connect_event_channel(connectionStructure);
          } else if (device_proxy.use_db()) {
              dbase = device_proxy.get_db_obj();
          }
          EventChannelStruct eventChannelStruct = channel_map.get(channelName);
          eventChannelStruct.adm_device_proxy = device_proxy.get_adm_dev();
          eventChannelStruct.use_db = device_proxy.use_db();
          eventChannelStruct.dbase = dbase;
  
          device_channel_map.put(deviceName, channelName);
      }
docs: ===============================================================