@Override
    public void close() {
        if (this.running.compareAndSet(true, false) && !ObjectUtils.isEmpty(this.watchFutures)) {
            this.watchFutures.forEach(watchFuture -> watchFuture.cancel(true));
        }
        if (!ObjectUtils.isEmpty(newService)) {
            consulClient.agentServiceDeregister(newService.getId(), token);
            ttlScheduler.remove(newService.getId());
        }

    }
The type Consul instance register repository.
shenyu-registry/shenyu-registry-consul/src/main/java/org/apache/shenyu/registry/consul/ConsulInstanceRegisterRepository.java