You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/12/05 07:22:34 UTC

[GitHub] [shenyu] tian-pengfei commented on a diff in pull request #4236: [ISSUE #4235]supports generation of mock data on request

tian-pengfei commented on code in PR #4236:
URL: https://github.com/apache/shenyu/pull/4236#discussion_r1039223105


##########
shenyu-plugin/shenyu-plugin-mock/src/main/java/org/apache/shenyu/plugin/mock/generator/ExpressionGenerator.java:
##########
@@ -49,8 +47,10 @@ public String getName() {
     public String doGenerate(final List<String> params, final String rule, final MockRequest mockRequest) {
 
         String expression = params.get(0);
-        CONTEXT.setVariable("req", mockRequest);
-        Object val = PARSER.parseExpression(expression).getValue(CONTEXT);
+        EvaluationContext context = initContext();

Review Comment:
   Generation mock data on request  in multithreading is not safe



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org