Skip to content

dubbo2.js@2.3.7

Compare
Choose a tag to compare
@hufeng hufeng released this 19 Dec 06:12

上游dubbo2.6.3增加了provider 到 consumer的attachment,
我们做一个协议上的同步
apache/dubbo#889

因为attachment目的是为了隐式的传参,所以我们不会把这个值合入正常的返回结果中。

因为我们有很好的middleware的机制,可以很方便的从middleware的上下获取这个attachment参数

const dubbo = new Dubbo({
// todo
});


dubbo.use(async (ctx, next) => {
   await next();
   console.log(ctx.providerAttachments);
})

enjoy <3