Skip to content

Commit

Permalink
dubbo provider add getBusinessParams
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 committed Dec 3, 2021
1 parent 97de0ef commit 69fba32
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

import com.alibaba.chaosblade.exec.common.aop.EnhancerModel;
import com.alibaba.chaosblade.exec.common.model.action.delay.TimeoutExecutor;
import com.alibaba.chaosblade.exec.common.util.BusinessParamUtil;
import com.alibaba.chaosblade.exec.common.util.ReflectUtil;
import com.alibaba.chaosblade.exec.plugin.dubbo.DubboConstant;
import com.alibaba.chaosblade.exec.plugin.dubbo.DubboEnhancer;
import com.alibaba.chaosblade.exec.spi.BusinessDataGetter;

import java.util.Map;

Expand All @@ -41,8 +43,14 @@ protected TimeoutExecutor createTimeoutExecutor(ClassLoader classLoader, long ti
}

@Override
protected Map<String, Map<String, String>> getBusinessParams(Object invocation) throws Exception {
return null;
protected Map<String, Map<String, String>> getBusinessParams(final Object invocation) throws Exception {
return BusinessParamUtil.getAndParse(DubboConstant.TARGET_NAME, new BusinessDataGetter() {
@Override
public String get(String key) throws Exception {
Map<String, String> attachments = ReflectUtil.invokeMethod(invocation, GET_ATTACHMENTS, new Object[0], false);
return attachments.get(key);
}
});
}

@Override
Expand Down

0 comments on commit 69fba32

Please sign in to comment.