简体   繁体   中英

Dynamic variable in Flow in MULE..?

I have a Flow in MULE which contains a HTTP inbound and component class like below :

<flow name="MetaService">
    <http:inbound-endpoint address="http://localhost:8000/jcore/meta/user"  
transformer-refs="HttpParams" responseTransformer-refs="JavaObjectToJson">
    </http:inbound-endpoint>
    <component class = "com.jcore.Meta" />
</flow>

Now if i have to accept request for another URL, like "localhost:8000/jcore/meta/user2", i have to create another flow..!!

Is there any option in MULE like "localhost:8000/jcore/meta/{variable}" , where in i can read that variable and call the appropriate component class according to that..??

  • Consider creating JAX-RS annotated resources and the Jersey Module so all this URL-based dispatching will be done automatically for you.
  • Otherwise, just bind MetaService to "http://localhost:8000/jcore/meta", then have a choice router that looks at the actual request path ("/jcore/meta/user" or "/jcore/meta/user2") and dispatch to the right destination accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM