I have the following code to configure a Jersey service at "http://localhost:8080/alpha":
*** my mule config ***
<flow name="flow1">
<inbound-endpoint address="http://localhost:8080/" exchange-pattern="request-response" />
<jersey:resources>
<component>
<singleton-object class="com.address.Flow1Resource"/>
</component>
</jersey:resources>
</flow>
*** Flow1Resource.java ***
@Path("/alpha")
public class Flow1Resource {...}
I want to add a new inbound-endpoint that handles all the addresses under "http://localhost:8080" except "http://localhost:8080/alpha" (e.g. "http://localhost:8080/beta"). These new addresses need a single jersey resource. For example:
*** my mule config ***
<flow name="flow1">
<inbound-endpoint address="http://localhost:8080/" exchange-pattern="request-response" />
<jersey:resources>
<component>
<singleton-object class="com.address.Flow1Resource"/>
</component>
</jersey:resources>
</flow>
<flow name="flow2">
<inbound-endpoint address="http://localhost:8080/*" exchange-pattern="request-response" />
<jersey:resources>
<component>
<singleton-object class="com.address.Flow2Resource"/>
</component>
</jersey:resources>
</flow>
*** Flow1Resource.java ***
@Path("/alpha")
public class Flow1Resource {...}
*** Flow2Resource.java ***
@Path("/")
public class Flow2Resource {
@Path("beta")
public void beta() {...}
@Path("gamma")
public void gamma() {...}
...
}
How do I set up the mule inbound-endpoint to capture all the addresses (i.e. beta & gamma), except for a specific url (i.e. alpha).
I know that I can hardcode the paths in the mule config, but this would result in duplication because each address (i.e. beta & gamma) would need its own flow and resource code, which are similar.
Please note that I used "http://localhost:8080/*" in the code above as an conceptual example. It does not work.
--- Update ---
I forgot to mention that the beta and gamma uri's also have security associated with them using:
<http:inbound-endpoint ...>
<spring-security:http-security-filter realm="mule-realm"/>
</http:inbound-endpoint>
I tried adding a 'choice' element to the endpoint, but it complained that spring-security was invalid inside the choice decision structure.
A solution would also need to accommodate this feature.