├── conf ├── flume-env.sh └── flume.conf ├── src ├── main │ ├── assembly │ │ └── standalone.xml │ └── java │ │ └── com │ │ └── aweber │ │ └── flume │ │ ├── source │ │ └── rabbitmq │ │ │ ├── RabbitMQSource.java │ │ │ └── Consumer.java │ │ └── sink │ │ └── rabbitmq │ │ └── RabbitMQSink.java └── test │ └── java │ └── com │ └── aweber │ └── flume │ └── TestRabbitMQSource.java ├── .travis.yml ├── .gitignore ├── LICENSE ├── Vagrantfile ├── pom.xml └── README.md /conf/flume-env.sh: -------------------------------------------------------------------------------- 1 | export JAVA_OPTS="-Xms1g \ 2 | -Xmx2g \ 3 | -XX:MaxDirectMemorySize=256m \ 4 | -XX:+UseParNewGC -XX:+UseConcMarkSweepGC" 5 | -------------------------------------------------------------------------------- /src/main/assembly/standalone.xml: -------------------------------------------------------------------------------- 1 | 2 | standalone-${version} 3 | 4 | jar 5 | 6 | false 7 | 8 | 9 | true 10 | runtime 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: java 3 | cache: 4 | directories: 5 | - "$HOME/.m2/repository" 6 | jdk: 7 | - oraclejdk8 8 | after_success: 9 | - bash <(curl -s https://codecov.io/bash) 10 | before_deploy: 11 | mvn package 12 | deploy: 13 | provider: releases 14 | api_key: 15 | secure: CkiqeHfVkf6HeYW6wpBDg8j4GcW3+6I3EKqPXX8CI3oZdM32RU2jU8Jo977g2tLpMvPQRMO+pFXUMTBU1ScTG7eQz0fYoseoCfrTNU2ANHh6vdrIVEvxKXAj2tf4VxLiEVj97PJVHvQfD+XaT6BvIwIWlxNb3bycsXM4KGGlYZg= 16 | file: $TRAVIS_BUILD_DIR/target/rabbitmq-flume-plugin-standalone-$TRAVIS_TAG.jar 17 | on: 18 | repo: aweber/rabbitmq-flume-plugin 19 | jdk: oraclejdk7 20 | tags: true 21 | all_branches: true 22 | -------------------------------------------------------------------------------- /conf/flume.conf: -------------------------------------------------------------------------------- 1 | # Name the components on this agent 2 | a1.sources = r1 3 | a1.sinks = k1 4 | a1.channels = c1 5 | 6 | # Describe/configure the source 7 | a1.sources.r1.channels = c1 8 | a1.sources.r1.type = com.aweber.flume.source.rabbitmq.RabbitMQSource 9 | a1.sources.r1.queue = events_for_s3 10 | a1.sources.r1.threads = 2 11 | a1.sources.r1.interceptors = i1 12 | 13 | a1.sources.r1.interceptors.i1.type = org.apache.flume.interceptor.TimestampInterceptor$Builder 14 | a1.sources.r1.interceptors.i1.preserveExisting = true 15 | 16 | # Describe/configure the sink 17 | a1.sinks.k1.type = hdfs 18 | a1.sinks.k1.channel = c1 19 | a1.sinks.k1.hdfs.path = /flume/events/%Y/%m/%d/%H/%{routing-key}/%{host} 20 | a1.sinks.k1.hdfs.round = true 21 | a1.sinks.k1.hdfs.roundValue = 10 22 | a1.sinks.k1.hdfs.roundUnit = minute 23 | a1.sinks.k1.hdfs.writeFormat = Text 24 | a1.sinks.k1.hdfs.fileType = DataStream 25 | a1.sinks.k1.hdfs.rollInterval = 60 26 | a1.sinks.k1.hdfs.rollCount = 0 27 | a1.sinks.k1.hdfs.rollSize = 0 28 | a1.sinks.k1.hdfs.batchSize = 50000 29 | a1.sinks.k1.hdfs.fileSuffix = .txt 30 | a1.sinks.k1.hdfs.filePrefix = events 31 | 32 | # Use a channel which buffers events in memory 33 | a1.channels.c1.type = memory 34 | a1.channels.c1.capacity = 1000000 35 | a1.channels.c1.transactionCapacity = 100000 36 | a1.channels.c1.byteCapacity = 0 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | bin/ 3 | 4 | ### JetBrains template 5 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 6 | 7 | *.iml 8 | 9 | ## Directory-based project format: 10 | .idea/ 11 | # if you remove the above rule, at least ignore the following: 12 | 13 | # User-specific stuff: 14 | # .idea/workspace.xml 15 | # .idea/tasks.xml 16 | # .idea/dictionaries 17 | 18 | # Sensitive or high-churn files: 19 | # .idea/dataSources.ids 20 | # .idea/dataSources.xml 21 | # .idea/sqlDataSources.xml 22 | # .idea/dynamic.xml 23 | # .idea/uiDesigner.xml 24 | 25 | # Gradle: 26 | # .idea/gradle.xml 27 | # .idea/libraries 28 | 29 | # Mongo Explorer plugin: 30 | # .idea/mongoSettings.xml 31 | 32 | ## File-based project format: 33 | *.ipr 34 | *.iws 35 | 36 | ## Plugin-specific files: 37 | 38 | # IntelliJ 39 | out/ 40 | 41 | # mpeltonen/sbt-idea plugin 42 | .idea_modules/ 43 | 44 | # JIRA plugin 45 | atlassian-ide-plugin.xml 46 | 47 | # Crashlytics plugin (for Android Studio and IntelliJ) 48 | com_crashlytics_export_strings.xml 49 | crashlytics.properties 50 | crashlytics-build.properties 51 | 52 | 53 | ### Java template 54 | *.class 55 | 56 | # Mobile Tools for Java (J2ME) 57 | .mtj.tmp/ 58 | 59 | # Package Files # 60 | *.jar 61 | *.war 62 | *.ear 63 | 64 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 65 | hs_err_pid* 66 | 67 | 68 | ### Maven template 69 | target/ 70 | pom.xml.tag 71 | pom.xml.releaseBackup 72 | pom.xml.versionsBackup 73 | pom.xml.next 74 | release.properties 75 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 AWeber Communications 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the rabbitmq-flume-plugin nor the names of its 13 | contributors may be used to endorse or promote products derived from this 14 | software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 20 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | $script = <