Testing filters

We have defined a filter that filters out all messages except java feed. What is so special about filters that we want to discuss them separately? If you remember, filters always return a Boolean value, indicating whether to pass on the message or drop it, based on whether or not it satisfies the condition. For ease of reference, the following code snippet is the filter that we have defined:

import java.util.List; import org.springframework.messaging.Message; import com.sun.syndication.feed.synd.SyndCategoryImpl; import com.sun.syndication.feed.synd.SyndEntry; public class SoFeedFilter { public boolean filterFeed(Message<SyndEntry> message){ SyndEntry entry = message.getPayload(); List<SyndCategoryImpl> categories=entry.getCategories(); ...

Get Spring Integration Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.