Giter VIP home page Giter VIP logo

adobeio-samples-journaling-events's Introduction

adobeio-samples-journaling-events

Welcome to my Adobe I/O Application! By reading this repo, we assume that you already know basic Project Firefly App development If not, please refer to Project Firefly Developer Guide

Background

  • This is a Project Firefly APP work as a POC example for high availability solution for cosuming events by using journaling API for a codelab

Problem

  • There is a class of Firefly apps in which customers want guarantees that the I/O Events are processed (there are no events lost due to an error in Runtime). current webhook based solution (the code running on Runtime would be made available as a webhook and I/O Events will deliver events to that webhook) is the push mode which not provide a solution for the peak event load case. Today, in case there is a surge of events a Runtime webhook would return 429 responses beyond the concurrency limit, thereby causing the webhook to be marked unreachable and causing no further events to be delivered โ€“ even when the surge stops. In this POC, we consume events via the Journaling API in a way that a client could always "ride the peak" by trading-off the near real-time guarantee in the process.

Solution

  • Use the Journaling API to retrieve the events instead of relying on the webhook approach.
  • Use a runtime action that uses the Alarm package to read the events every X minutes
  • The Alarm action store the events in the Firefly storage.
  • Index of events has been recorded in storage that if the action fails, the next invocation will retrieve from the same index, thus no events are lost

How to use

This repo contains two folder

  • Event provider
  • Event consumer

Event provider

In this folder, we create a custom event publisher which takes care of generating events, then we use project firefly alarms packages to automate it. e.g. 100 events / min. This events is configured to send to Journaling API, so the event consumer could consume these events from there.

More details about how to set up custom events and alarm package: custom events alarm package

Event consumer

This folder contains the event consumer, we create another Project Firefly headless app to create cron jobs with alarms, we set up recurring jobs to pull from journalling API every x mins and write into project firefly storage. Project Firefly using aio-lib-state as storage library

More details about how to set up aio-lib-state storage: Building a Firefly Todo App with aio-lib-state and React Spectrum

More

Event provider and Event consumer both need to be deployed as a Project Firefly App under different namespace to make sure end to end workflow. So for that purpose, you may need to create two projects at Console Creating your First Project Firefly Application

If successfully set up, you should be able to see events been wroten into storage pulled from jouranling API periodically. For your debugging purpose I also provide a sample code to send the event to slack webhook.

adobeio-samples-journaling-events's People

Contributors

yu1986 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.