Channel selectors
As we previously discussed in Chapter 1, Overview and Architecture, a source can write to one or more channels. This is why the property is plural (channels
instead of channel
). There are two ways multiple channels can be handled. The event can be written to all of the channels or to just one based on some Flume header value. The internal mechanism for this in Flume is called a channel selector.
The selector for any channel can be specified using the
selector.type
property. Any selector specific properties begin with the usual source prefix; agent name, the keyword sources, and the source name:
agent.sources.s1.selector.type=replicating
Replicating
By default, if you do not specify a selector for a source, replicating
is the default. The replicating selector writes the same event to all channels in the source's channels list:
agent.sources.s1.channels=c1 c2 c3 agent.sources.s1.selector.type=replicating
In this example, every event will be written to all three channels, c1
, c2...