You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "StevenKin (GitHub)" <gi...@apache.org> on 2019/09/26 04:17:51 UTC

[GitHub] [dubbo] StevenKin commented on issue #5115: how to get dubbo instance's ip, port and timestamp when started?

there is my demo
`//may start multiple main process 
public static void main(String[] args) throws IOException {
        System.out.println("start test......");
        ApplicationConfig application = new ApplicationConfig();
        RegistryConfig registry = new RegistryConfig();
        application.setName("test");
        registry.setAddress("127.0.0.1:2181");
        registry.setProtocol("zookeeper");
        ProtocolConfig protocol = new ProtocolConfig();
        protocol.setName("dubbo");
        //random port, i don't know now
        protocol.setPort(-1);
         protocol.setThreads(200);

        ServiceConfig<TestService> service1 = new ServiceConfig<>();
        service1.setApplication(application);
        service1.setRegistry(registry);
        service1.setProtocol(protocol);
        service1.setInterface(TestService.class);
        service1.setRef(new TestServiceImpl());

        service1.export();
        // i need get the port, ip and start time as key save to log or mysql now,why need save to mysql ,because when the process crashe, other process can get data related to this  key doing aftercare,please tell me how to get port, ip and start time

        System.in.read();

    }`

[ Full content available at: https://github.com/apache/dubbo/issues/5115 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org