From e824abf9fb24bbb2d05df908b44aa78540a547d1 Mon Sep 17 00:00:00 2001 From: benyamin2014 Date: Wed, 6 Jul 2022 18:52:43 +0800 Subject: [PATCH] Update ParamFlowSlot.java Assign actual value with the result of paramFlowKey method --- .../csp/sentinel/slots/block/flow/param/ParamFlowSlot.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowSlot.java b/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowSlot.java index 0739a06a80..f798c2be95 100644 --- a/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowSlot.java +++ b/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParamFlowSlot.java @@ -82,6 +82,10 @@ void checkFlow(ResourceWrapper resourceWrapper, int count, Object... args) throw String triggeredParam = ""; if (args.length > rule.getParamIdx()) { Object value = args[rule.getParamIdx()]; + // Assign actual value with the result of paramFlowKey method + if (value instanceof ParamFlowArgument) { + value = ((ParamFlowArgument) value).paramFlowKey(); + } triggeredParam = String.valueOf(value); } throw new ParamFlowException(resourceWrapper.getName(), triggeredParam, rule);