Code Monkey home page Code Monkey logo

knotx-fragments's Introduction

Build Status CodeFactor codecov Gradle Status

Knot.x Fragments

While Knot.x HTTP Server is a "hearth" of Knot.x, Fragments processing is its "brain".

Knot.x Fragments is a Swiss Army knife for integrating with dynamic data sources. It comes with distributed systems stability patterns such as a circuit breaker to handle different kinds of network failures. Thanks to those build-in mechanisms you can focus more on delivering business logic and be ready to handle any unexpected integration problems.

Knot.x Fragments encourages to decompose business logic into a chain of simple steps that later can be wrapped with integration stability patterns without code changes. Besides, when the chain becomes more complex and additional failure scenarios are known, failure logic can be adjusted with fallback configuration (no changes in the business logic required).

Knot.x Fragments is designed to build fault-tolerant, back-end integrations such as:

  • API Gateways, Backend For Frontend (BFF) for single-page applications (SPA), Web APIs
  • documents processing (HTML, JSON, PDF etc) with a templating engine support

How does it work

Knot.x Fragments is a set of Handlers that are plugged into the Knot.x Server request processing.

Fragments processing starts with converting an HTTP request to one or more Fragments that are then evaluated and eventually combined into an HTTP response.

Supply Fragments

Fragments are the result of a request being split (e.g. HTML markup) into smaller, independent parts by the Fragments Supplier.

Fragments

Evaluate Fragments

Each Fragment can specify a processing Task that points to a named, directed graph of executable nodes.

Each node transforms the Fragment's content, updates its payload and finally responds with Transition.

Nodes are connected with each other with Transitions, directed graph edges.

You may read more about it in the Fragments Handler API.

Action is a node with possible restrictions imposed. E.g. its execution can be limited to a certain time. If this does not end within that time, Action will time out. In this case, the Action responds with an error Transition, which indicates that some fallback node can be applied.

Assemble Fragments

Finally, after all the Fragments were processed, they are combined into a single response by the Fragments Assembler handler.

Example: HTML template processing

Read more about configuring HTML template processing in the Knot.x Example Project.

Modules

Each module contains its own documentation inside.

License

Knot.x Fragments is licensed under the Apache License, Version 2.0 (the "License")

Icons come from https://www.slidescarnival.com and use Creative Commons License Attribution 4.0 International.

knotx-fragments's People

Contributors

dragarthpl avatar malaskowski avatar marcinkp avatar marcinus avatar oskarjerzyk avatar skejven avatar tomaszmichalak avatar voycawojka 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.