Choice Router in Mule 4

What is choice router?

  • Choice router is used to route the flow based on the dataweave expression.

  • It is used to route only to one flow.

  • If no match is found it will route to default flow.

Example:

  1. Create a new mule project and select choice router from mule palatte.

  2. Here we are taking the SetVariable from Mule Palette and setting the queryParams as value.

  3. Add Choice Router giving the condition value is over 90 with payload as "Value greater than 90", if value is over 70 with payload as "Value greater than 70" and by default with payload "No Matching value"

  1. Test the endpoint through postman