Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Why do two callbacks happen? #423

Description

@yancheng199287
     val svHealth = ServiceHealthCache.newCache(healthClient, serviceName, false, 10, QueryOptions.BLANK)
        svHealth.addListener { newValues: Map<ServiceHealthKey, ServiceHealth> ->
            run {
                println("----------------")
                logger.info(JSON.toJSONString(IMServerInstance.parserConsulClientServiceInstance(newValues)))
            }
        }
        svHealth.start()

my log show twice callback for same service id when I kill a server

as follows

----------------
21:41:14.435 [OkHttp http://localhost:8500/...] INFO com.oneinlet.ConsulClientService - {"dataCenter":"dc1","id":"c87870158a643ec79044af3997524ee5","metaData":{"serverInstancePublicIp":"localhost"},"name":"Interesting-IM-Service","nodeAddress":"127.0.0.1","nodeName":"DESKTOP-EOTSJE5","serverInstancePort":80,"serviceTagList":[],"status":"critical"}
21:41:15.431 [OkHttp http://localhost:8500/...] DEBUG com.orbitz.consul.cache.ConsulCache - Consul cache updated for health.service "Interesting-IM-Service" (index=339), request duration: 996 ms
----------------
21:41:15.432 [OkHttp http://localhost:8500/...] INFO com.oneinlet.ConsulClientService - {"dataCenter":"dc1","id":"c87870158a643ec79044af3997524ee5","metaData":{"serverInstancePublicIp":"localhost"},"name":"Interesting-IM-Service","nodeAddress":"127.0.0.1","nodeName":"DESKTOP-EOTSJE5","serverInstancePort":80,"serviceTagList":[],"status":"critical"}
2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions