Skip to content
Fragments map-reduce processing using Graph flows, supplier and assembler.
Java Kotlin HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
api
assembler
assets/images
gradle/wrapper
handler
supplier
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
azure-pipelines.yml
build.gradle.kts
gradle.properties
gradlew
gradlew.bat
settings.gradle.kts

README.md

Build 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:

  • Gateway APIs, Backend For Frontend (BFF) for single-page applications (SPA), Web APIs
  • documents processing (HTML markup, 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.

Processing of fragments begins by converting a HTTP request to one or more Fragments that are then evaluated and eventually combined into a 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 Actions.

Each Action transforms the Fragment's content and/or updates its payload.

Fragment's path in the Task graph is defined by Action's outputs, called Transitions.

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

Action is a simple function (business logic) with possible restrictions imposed. E.g. the function 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 Action can be applied.

Additionally, Actions are executed in parallel when they are independent of each other. More details can be found here.

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.

You can’t perform that action at this time.