thubbo / jmeter-plugins-for-apache-dubbo

Dubbo Plugin for Apache JMeter, It is a plug-in developed for testing Dubbo in Jmeter.
Apache License 2.0
565 stars 290 forks source link

dubbo rpc context #101

Closed cheongwen closed 4 years ago

cheongwen commented 4 years ago

调用dubbo服务时,服务端处理逻辑需要获取RpcContext中内容,使用插件时需要如何设置。

目前增加beanshell预处理,服务端不能获取到,请问要如何设置,才能使服务能够正常获取context?

import com.alibaba.dubbo.rpc.RpcContext;

RpcContext.getContext().setAttachment("userId", "xxx");
RpcContext.getContext().setAttachment("userNameCN", "xx");
ningyu1 commented 4 years ago

@cheongwen 你说的是在jmeter中设置隐士参数给RPC服务端使用。 插件版本2.7.3以上版本支持设置隐士参数,具体的用法在方法参数表格的头上有一个切换Attachment表格,这里是设置隐士参数的

ningyu1 commented 4 years ago

image