stampy88 / flume-amqp-plugin

A plugin for Flume that allows you to use an AMQP broker as a source.
29 stars 8 forks source link

flume-amqp-plugin

The flume-amqp-plugin allows you to use an AMQP broker as a Flume Source.

Getting Started

  1. Copy the entire folder to ${flume_dir}/plugins

  2. cd ${flume_dir}/plugins/flume-amqp-plugin

  3. Build by running 'ant'. A flume-amqp-plugin.jar file should be created.

  4. Modify ${flume_dir}/conf/flume-site.xml

flume.plugin.classes amqp.AmqpEventSource Comma separated list of plugin classes
  1. cd into the top-level flume directory (above plugins).

Set FLUME_CLASSPATH for all terminals which will run Flume master or node:

export FLUME_CLASSPATH=pwd/plugins/flume-amqp-plugin/flume-amqp-plugin.jar:pwd/plugins/flume-amqp-plugin/lib/amqp-client-2.1.0.jar

Usage

The AMQP Event Source will take message from an AMQP broker and create Flume events from the message's body.

The only required argument is the exchangeName parameter. Note that each parameter needs to be enclosed in quotes because the plugin uses named parameters for setting up the source.

amqp("exchangeName=exchangeName",
     "[,host=host] "
     "[,port=port] "
     "[,virtualHost=virtualHost] "
     "[,userName=user] "
     "[,password=password] "
     "[,exchangeType=direct] "
     "[,durableExchange=false] "
     "[,queueName=queueName] "
     "[,durableQueue=false] "
     "[,exclusiveQueue=false] "
     "[,autoDeleteQueue=false] "
     "[,bindings=binding1,binding2,bindingN]
     "[,useMessageTimestamp=false])"

Examples

  1. Broker is on same node as flume agent, direct exchange type and two bindings

    amqp("exchangeName=alertMessages", "bindings=system, application")

  2. Broker is on different machine, direct exchange type, shared queue

    amqp("exchangeName=stockTrades", "host=10.23.224.2", "bindings=IBM,GOOG,MSFT")