Skip to content

Instantly share code, notes, and snippets.

@stdatalabs
Created September 29, 2016 18:45
Show Gist options
  • Save stdatalabs/a9e223fd2faa7ac83c964036ff78e7e4 to your computer and use it in GitHub Desktop.
Save stdatalabs/a9e223fd2faa7ac83c964036ff78e7e4 to your computer and use it in GitHub Desktop.
A Flume Avro source to consume Twitter Stream
TwitterAgent.sources = Twitter
TwitterAgent.channels = MemChannel
TwitterAgent.sinks = avroSink
# Describing/Configuring the source
TwitterAgent.sources.Twitter.type = org.apache.flume.source.twitter.TwitterSource
TwitterAgent.sources.Twitter.consumerKey=<-- paste consumer key here -->
TwitterAgent.sources.Twitter.consumerSecret=<-- paste consumer secret here -->
TwitterAgent.sources.Twitter.accessToken=<-- paste access token here -->
TwitterAgent.sources.Twitter.accessTokenSecret=<-- paste access token here -->
# Describing/Configuring the sink
TwitterAgent.sinks.avroSink.type = avro
TwitterAgent.sinks.avroSink.batch-size = 1
TwitterAgent.sinks.avroSink.hostname = ubuntu
TwitterAgent.sinks.avroSink.port = 9988
# Describing/Configuring the memory channel
TwitterAgent.channels.MemChannel.type = memory
TwitterAgent.channels.MemChannel.capacity = 10000
TwitterAgent.channels.MemChannel.transactionCapacity = 100
# Linking the source and sink to the memory channel
TwitterAgent.sources.Twitter.channels = MemChannel
TwitterAgent.sinks.avroSink.channel = MemChannel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment