有没有一种方法可以在anypoint平台上获得端点列表



我希望获得通过anypoint平台通过CLI或anypoint REST API公开的端点列表。即使它是应用程序的端点列表,我也可以将它们编译在一起。

您基本上可以通过循环流来获得端点列表。对于我的例子,我只有接受POST和GET请求的端点,所以我的例子就是基于此:

Collection<FlowConstruct> flowConstructs = muleEventContext.getMuleContext()
.getRegistry()
.lookupFlowConstructs(); 
Iterator<FlowConstruct> iterator = flowConstructs.iterator();
while (iterator.hasNext()) {
String flowName = iterator.next().getName();
if (flowName.startsWith("post:") || flowName.startsWith("get:")) {
Flow flow = muleEventContext.getMuleContext().getRegistry().get(flowName);
// You can process the flowName to extract endpoint
}
}

最新更新