sofastack / sofa-rpc-node

SOFARPC Node is a high-performance, high-extensibility, production-level Nodejs RPC framework.
MIT License
612 stars 64 forks source link

how to re-publish after reconnected to the zookeeper ? #25

Closed wziww closed 5 years ago

wziww commented 5 years ago

After the connection expired , it will auto reconnect , but how can we re-publish the provider ? is there any way to do sth like this :

server.start()
    .then(async () => {
        server.publish();
        server.on('server:event', async (e) => {
            if (e.type === 'zookeeper' && e.name === 'connected') {
                server.services.get(e.id).rePublish();
            }
        });
    });
gxcsoccer commented 5 years ago

i think zk registry will re-publish automatically, if not i think it's a bug

gxcsoccer commented 5 years ago

i will add testcase for connection expired

gxcsoccer commented 5 years ago

i's a bug 🐛