Does make sense to me. Frankly, I do no have prior knowledge of Spring Integration. The above case was the first one I was trying to implement.
I know that Apache Camel uses the notion of Predicate, which can be integrated into the Message Filter of Content Based Filter for various data format. I do not know the architecture of the Spring Integration, but it makes sense to abstract the notion of predicate, otherwise you end up building XPath, JSON, bean, map and etc. content based routers.
Also, looking at the example from the post with the recipient-list-router (i.e.
<int:recipient channel="infant" selector-expression="headers['passengerAge'] le 1" />
), it would be more straightforward and intuitive to use the XPath expression in the selector-expression (e.g.
selector-expression="/passenger/age le 1" />
), rather then using content enricher to store a temporary variable. This seems to me unnecessary step or a workaround that a user of a framework should make in order to implement a uses case. Instead it should be supported by framework itself.