The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

OrBee (61) [Avatar] Offline
#1
In chapter 5 example Chapter05Examples.xml,
The text states "Mule's filtering routers enable to selectively block messages from continuing in a flow"

I apply an expression filter to my flow along the same lines but it still allows the component in my flow to process the payload. A transformer returns a payload when it fails to transform the message and the filter detects that payload to prevent further processing, similar to filtering based on high priority orders.

<flow name="myflow">
<transformer ref="trans-csv"/>
<logger level="INFO" message="Before class is : #[payload.class]/> <br /> <expression-filter expression="payload.class !=my.package.SomeClass"/>
<logger level="INFO" message="After class is : #[payload.class]/> <br /> <component> <br /> <spring:object bean="component/>
</component>
</flow>

The expression filter does get executed but it still allows entry to the component in the flow. I know this to be so because the second logger is never executed. However if I change the expression filter to
<expression-filter expression="payload.class ==my.package.SomeClass"/>
then the second logger gets executed as well. The confusing aspect for me is why the logger is not executed but the component is invoked to process the very message it is supposed to block


My understanding from reading the book was that the filters enforce selectively process only messages satisfying the criteria specified in the filter. That's not how it seems to be working in this instance.

Am I misunderstanding how the filter is supposed to work?
OrBee (61) [Avatar] Offline
#2
Ignore Previous Message: It works as expected
Please ignore previous message, works as expected. An exception was thrown whilst trying to load the drivers for the component which I thought was a result of call the component