Simple SAGA example using amqp and nodejs

Overview

Simple SAGA example using amqp and nodejs

The banks works as the following the diagram:

bank system diagram

All the banks are listening their own queue on the broker. Everytime some transactions comes, they try to resolve it. When the transaction fail, the bank sends a compensation rolling back the transaction to the sender bank.

How to use it

Before everything, start the rabbit:

./start-rabbit.sh

to create a bank

node src/create-bank.js 
   

   

to create an account

node src/create-account.js 
   

   

to transfer between accounts

node src/transfer.js 
    
     
      
       
        
       
      
     
    
   

You can start a batch listener using

node src/batch-bank.js 
   

   

You can deposit using

node src/deposit.js 
    
     
     

     
    
   

You can withdraw using

node src/withdraw.js 
    
     
     

     
    
   
You might also like...

Example Serverless DynamoDB integration tests using Jest, TypeScript and the AWS CDK

Example Serverless DynamoDB integration tests using Jest, TypeScript and the AWS CDK

serverless dynamodb integration tests 🚀 Example Serverless DynamoDB integration tests using Jest, TypeScript and the AWS CDK Introduction How to inte

Nov 4, 2022

Solidity NFT whitelist contract example using MerkleTree.js for constructing merkle root and merkle proofs.

MerkleTree.js Solidity NFT Whitelist example Allow NFT minting only to whitelisted accounts by verifying merkle proof in Solidity contract. Merkle roo

Dec 29, 2022

Keyauth v1 example, includes a demo and is encrypted using aes.

Keyauth v1 example, includes a demo and is encrypted using aes.

Keyauth Keyauth V1.0 api wrapper in nodejs that includes requests being encrypted using aes. Discord & Support Server . Keyauth Example const Keyauth

Nov 27, 2022

High performance personalization & a/b testing example using Next.js, Edge Middleware, and Builder.io

High performance personalization & a/b testing example using Next.js, Edge Middleware, and Builder.io

Next.js + Builder.io Personalization & A/B Testing with Edge Middleware This is a fork of Next.js Commerce with Builder.io integrated and using Edge M

Sep 6, 2022

An simple blockchain example on node + typescript.

node-ts-blockchain An simple blockchain example on node + typescript. Next steps: Create a usefull README. Add a architecture to store the chain/block

May 30, 2022

A simple implementation example (framework) of Deso Protocol's Smart Services.

This project serves as a simple implementation example (framework) of Deso Protocol's Smart Services. This framework comes with out-of-the-box SSL, MongoDB, dev/stage/prod environments, and modularity.

Sep 22, 2022

A simple example repo that demonstrates the dynamic ephemeral storage solution for AWS Lambda outlined in the corresponding Storyboard Dev Blog post.

AWS Lambda Dynamic Ephemeral Storage Example A simple example repo that demonstrates the dynamic ephemeral storage solution for AWS Lambda outlined in

Jun 14, 2022

A simple JS example for NextAuth Google login with a popup window instead of redirect.

A simple JS example for NextAuth Google login with a popup window instead of redirect.

Dec 7, 2022

An example SvelteKit app implementing a simple authentication system.

An example SvelteKit app implementing a simple authentication system.

SvelteKit Auth Example An example SvelteKit app implementing a variety of authentication backends View the demo NOTE: this is very much a work in prog

Dec 30, 2022
Owner
jose teodoro da silva
I'm a Brazilian guy passionate by programming, agile processes, automation, devops, testing, video games and boardgames. Building software since 2008.
jose teodoro da silva
Example of how to instrument your BattleSnake with New Relic, using NodeJS

Instrummenting your BattleSnake with New Relic using NodeJS Learn how to instrument your BattleSnake with New Relic using the NodeJS agent. For this r

New Relic Experimental 1 Apr 29, 2022
Example-browserstack-reporting - This repository contains an example of running Selenium tests and reporting BrowserStack test results, including full CI pipeline integration.

BrowserStack reporting and Selenium test result example This repository contains an example of running Selenium tests and reporting BrowserStack test

Testmo 1 Jan 1, 2022
Example auto-generated OpenAPI client library and an accompanying example Angular app.

To utilize this demo Head into petstore_frontend\petes_pets Run npm install Go to frontend_client_lib\out Run npm install Head back into petstore_fron

Alan Gross 1 Jan 21, 2022
This is a nodejs implementation of the python example

DOC This is a nodejs implementation of the python example provided in https://github.com/EnAccess/OpenPAYGO-Token. In case of anything please feel fre

Shadrack Lilan 2 Jan 25, 2022
CLI Progress Bar implemented in NodeJS to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code

NodeJS-ProgressBar CLI Progress Bar for NodeJS and JavaScript to track Time, ETA and Steps for any long running jobs in any loops in JS, NodeJS code D

Atanu Sarkar 5 Nov 14, 2022
A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and configure Typescript on it.

CTSP- Create TS Project A CLI tool to create a NodeJS project with TypeScript CTSP is a CLI tool to make easier to start a new NodeJS project and conf

Jean Rodríguez 7 Sep 13, 2022
This is a simple script to upload Multiple files into google drive using google drive API and Nodejs.

Welcome to gDrive Multiple File Upload ?? This is a simple script to upload Multiple files into google drive using google drive API and Nodejs Install

Jayamal Sanuka Hettiarachchi 1 Dec 29, 2021
🍱 Simple nodejs support for using icons!

?? node-icons Usage Checkout its unit tests to see complete usage with output! import Icons from "node-icons"; const icons = Icons({ // auto install

(TS/JS).Gandalf(he/him) 6 Dec 29, 2021
Get-A-Room example application using Domain Driven Design and Clean Architecture. Written in TypeScript and deployed to AWS with a serverless stack.

Domain Driven Microservices on AWS in Practice This project provides a Domain Driven Design & Clean Architecture-informed, multi-service event-driven

Mikael Vesavuori 5 Dec 31, 2022
NextJS with GraphQL using type-graphl and graphql-codegen adoptable dogs example code

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jack Herrington 2 Mar 31, 2022