Closed ArvinSpace closed 2 years ago
-
`import {Dubbo, java, setting} from "dubbo2.js";
const dubboSetting = setting.match(/.*/, {version: '1.0.0'});
const dubbo = Dubbo.from({ application: {name: 'dubbbo-test'}, register: '127.0.0.1;2181', dubboVersion: '2.8.4', dubboInvokeTimeout: 20, dubboSetting, });
const service = dubbo.proxyService({ dubboInterface: 'yrt.nintybid.integral.service.TestService', version: '1.0.0', timeout: 10, methods: { sayHello(name: string) { return [java.String(name)]; }, }, });
(async () => { console.log(开始时间:${new Date()});
开始时间:${new Date()}
const {err, res} = await service.sayHello('Arvin'); console.log(`dubbo请求执行完时间:${new Date()}`); if (err) { console.error(err); return; } console.log(res);
})();`
@hufeng 麻烦帮忙看看为什么不行呢,跟DEMO是一样的吧,side加随机数了也超时
dubbo2.js版本2.3.9
-
`import {Dubbo, java, setting} from "dubbo2.js";
const dubboSetting = setting.match(/.*/, {version: '1.0.0'});
const dubbo = Dubbo.from({ application: {name: 'dubbbo-test'}, register: '127.0.0.1;2181', dubboVersion: '2.8.4', dubboInvokeTimeout: 20, dubboSetting, });
const service = dubbo.proxyService({ dubboInterface: 'yrt.nintybid.integral.service.TestService', version: '1.0.0', timeout: 10, methods: { sayHello(name: string) { return [java.String(name)]; }, }, });
(async () => { console.log(
开始时间:${new Date()}
);})();`