Content Filter
In some situations, it becomes necessary, when dealing with large messages, to remove and filter unimportant information from a message using a Content Filter integration pattern. This is the opposite of the Content Enricher pattern which was adding and supplementing data.
Â
The Content Filter pattern doesn’t just remove attributes, it is also quite useful in performing simplification via restructuring of the message structure. With complex messages, the structure is often represented as a hierarchical tree structure since many messages are originally from external systems or packaged applications. When these messages are aggregated together the result will tend to be many levels of nested, repeating groups. We have a tendency to create our complex messages modeled after generic, normalized database structures.
Upon closer examination of our message structures, and examination of known constraints and assumptions, we can determine that these complex hierarchies and nestings are superfluous. The role of the Content Filter is often employed to flatten the hierarchy into a simpler list of elements.