Coder Social home page Coder Social logo

firehose-sample's Introduction

Sample Firehose Integration

This is a sample showing how to integrate mParticle into a new API, using the mParticle Java SDK over Amazon's Lambda platform. If you're looking to add a new API to mParticle, clone and use this repo as a starting point!

Testing

The project is instrumented for unit testing with JUnit, run the tests from a command line interface with:

./gradlew clean test
JDK Version

The mParticle Java SDK on which this project depends is compiled using JDK 1.8. This means that you must use JDK 1.8 to compile this project and execute the tests.

Registration JSON

When running the tests you will see output at the console containing the JSON result of your registration implementation:

jdoe-mac:firehose-sample jdoe$ ./gradlew clean test
:sample-extension:clean
:sample-extension:compileJava
:sample-extension:processResources UP-TO-DATE
:sample-extension:classes
:sample-extension:compileTestJava
:sample-extension:processTestResources UP-TO-DATE
:sample-extension:testClasses
:sample-extension:test

com.mparticle.ext.sample.SampleExtensionTest > testProcessRegistrationRequest STANDARD_OUT

    Please send this JSON to mParticle:


    {"type":"module_registration_response","id":"2c5722e3-4537-4cf6-a3d0-1c0201b3a579","timestamp_ms":1457468552471,"sdk_version":"1.1.1","name":"Your Company Name","description":"A brief description of your company.","version":"1.0","permissions":{"user_identities":[{"type":"email","encoding":"raw","required":false},{"type":"customer","encoding":"raw","required":false}]},"event_processing_registration":{"account_settings":[{"type":"text","id":"apiKey","name":"API Key","description":"A short description of the purpose and usage of this setting.","visible":true,"required":true,"confidential":true}],"supported_event_types":["custom_event","push_subscription","push_message_receipt","user_attribute_change","user_identity_change"],"supported_runtime_environments":["android","ios"],"max_data_age_hours":24},"audience_processing_registration":{"account_settings":[{"type":"text","id":"apiKey","name":"API Key","description":"A short description of the purpose and usage of this setting.","visible":true,"required":true,"confidential":true}],"audience_subscription_settings":[{"type":"integer","id":"mailingListId","name":"Mailing List ID","visible":true,"required":false}]}}

When you have completed your registration function, execute the tests and send the JSON result to your mParticle Firehose project manager.

Building

When you're ready to test and deploy your lambda function, you'll upload it in jar or zip form to your AWS console. Run the following to generate sample-extension.zip in the sample-extension/build/distributions directory:

./gradlew build

firehose-sample's People

Contributors

samdozor avatar mbenua-mparticle avatar syedwasihaider avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.