Well, what you need to implement the custom Processor Module. Just follow with Custom Transformer sample from Spring XD Guilde
The custom Selector
for filter:
public class MySelector implements MessageSelector {
boolean accept(Message<?> message) {
...
}
}
Module ctx myfilter.xml
:
<channel id="input"/>
<filter input-channel="input" output-channel="output">
<beans:bean class="custom.MySelector" />
</filter>
<channel id="output"/>
Package your class to the jar and place everything to the dir ${xd.home}/modules/processors/myfilter
with structure:
/myfilter
/config
myfilter.xml
/lib
myfilter.jar
Test it like this:
xd:> stream create --name filtertest --definition "http | myfilter | log"