Warning: A non-numeric value encountered in /home/customer/www/archive.ricston.com/public_html/wp-content/themes/Divi/functions.php on line 5766

When a message is received on an inbound endpoint, Mule transforms it before passing it through the routers (and filters).  The logic behind this mechanism suggests that a message should be converted to its desired format before the requisite routing patterns can be applied.  This may not necessarily be the case in your scenario.

Consider a situation where you wish to read messages off a VM queue which represent new sales orders.  The service that you have processes delivery requests so you need to transform these sales orders into delivery requests but you only would want to do this if the sales order has been completed.  In such a situation, you need to query the original object and transform only if the sales order is completed.

<inbound>
<selective-consumer-router transformFirst=”false”>
<payload-type-filter expectedType=“com.ricston.messages.CompletedOrder”/>
</selective-consumer-router>
</inbound>

The transformFirst attribute of the selective-consumer router lets you control whether the transformation occurs first or not.  The default is to transform before routing (as explained) but in some cases, it’s useful to route before transformation.