Skip to content

Commit

Permalink
Fix the dispatching issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhashinee committed Nov 11, 2024
1 parent dcadbe4 commit 5dde35a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,6 @@ private static String getResolvedApiName(String contextPath, MessageContext synC
if (RESTUtils.matchApiPath(contextPath, apiContextPath)) {
apiName = api.getName();
synCtx.setProperty(RESTConstants.PROCESSED_API, api);
// Since the APIs are already sorted in descending order, we should stop at the first match with the context path.
// Continuing the loop could result in matching a path that only shares the same starting string.
// Ex: /test/ API context path will match with /test/1.0.0
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ protected void activate(ComponentContext ctxt) {
}
SynapseEnvironment synapseEnvironment = contextInfo.getSynapseEnvironment();
List handlers = synapseEnvironment.getSynapseHandlers();
if (System.getProperty(ServiceBusConstants.ENABLE_PROMETHEUS_API_PROPERTY) != null) {
if (System.getProperty(ServiceBusConstants.ENABLE_PROMETHEUS_API_PROPERTY) != null
&& System.getProperty(ServiceBusConstants.ENABLE_PROMETHEUS_API_PROPERTY).equals("false")) {
handlers.remove(handlers.stream().filter(c -> c instanceof MetricHandler).findFirst().orElse(null));
} else {
if (!handlers.stream().anyMatch(c -> c instanceof MetricHandler)) {
handlers.add(new MetricHandler());
}
Expand Down

0 comments on commit 5dde35a

Please sign in to comment.