import { Dubbo , dubboSetting } from 'apache-dubbo-consumer' ; import { Nacos } from 'apache-dubbo-registry' ; import * as services from './service' ; /**
 * setting dubbo invoke params, such version, group etc.
 */ const setting = dubboSetting . match ( [ 'org.apache.dubbo.demo.DemoProvider' , 'org.apache.dubbo.demo.ErrorProvider' , ] , { version : '1.0.0' , } ) . match ( 'org.apache.dubbo.demo.BasicTypeProvider' , { version : '2.0.0' } ) ; /**
 * create dubbo instance, it create proxyService
 */ const dubbo = new Dubbo < typeof services > ( { application : { name : 'dubbo-node-consumer' } , services , dubboSetting : setting , registry : Nacos ( { connect : 'localhost:8848' , } ) , } ) ; /**
 * apache-dubbo-js middleware Extension mechanism the same as koa middleware
 */ dubbo . use ( async ( ctx , next ) => { await next ( ) ; console . log ( '-providerAttachments-->' , ctx . providerAttachments ) ; } ) ; export default dubbo ;