Mule 有没有办法在anypoint平台上获取端点列表

Mule 有没有办法在anypoint平台上获取端点列表,mule,anypoint-studio,mulesoft,Mule,Anypoint Studio,Mulesoft,我希望获得通过任意点平台通过CLI或任意点REST API公开的端点列表。即使是应用程序的端点列表,我也可以将它们编译在一起。基本上可以通过循环流来获得端点列表。在我的例子中,我只有接受POST和GET请求的端点,因此我的示例基于此: Collection<FlowConstruct> flowConstructs = muleEventContext.getMuleContext()

我希望获得通过任意点平台通过CLI或任意点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
    }
}
Collection-flowConstructs=muleEventContext.getMuleContext()
.getRegistry()
.LookupFlowConstructions();
迭代器迭代器=FlowConstructions.Iterator();
while(iterator.hasNext()){
字符串flowName=iterator.next().getName();
if(flowName.startsWith(“post:”)| flowName.startsWith(“get:”){
Flow-Flow=muleEventContext.getMuleContext().getRegistry().get(flowName);
//您可以处理流名称以提取端点
}
}