Poc-krakend: Allows you to create, modify and delete enpoints in "configuration.json" without restart the application.

poc-krakend

Description

This POC is for test dynamic (Hot reload) routes in krakend.

Allows you to create, modify and delete enpoints in "configuration.json" without restart the application.

At the bottomm of the document, you can view some examples about it.

Demo Video

The next video shows how to run and modify the endpoints

asciicast

Installation

  • For run the POC, enter the following commands. It is neccesary to create a new folder to clone the different forks for the corresponding projects.
mkdir POC
cd POC
git clone https://github.com/arturoeanton/poc-krakend.git
git clone https://github.com/arturoeanton/lura.git
git clone https://github.com/arturoeanton/gin.git

cd poc-krakend
go mod vendor
go run .

In the case of the gin pull request, the modification is the following. This modification allows to reset search tree at gin level.

func (e *Engine) ResetTrees() {
	e.trees = make(methodTrees, 0, 9)
}

Hot reload

touch configuration.json

Examples

  • Based on this initial configuration file we will make some examples.
{
	"version": 2,
	"name": "Express API Gateway",
	"endpoints": [
		{
			"endpoint": "/pokemon",
			"method": "GET", 
			"backend": [
				{ 
					"host": ["https://pokeapi.co"],
					"method": "GET",
					"url_pattern": "/api/v1/pokemon/ditto"
				}
			]
		},
		{
			"endpoint": "/type/{id}",
			"method": "GET", 
			"backend": [
				{ 
					"host": ["https://pokeapi.co"],
					"method": "GET",
					"url_pattern": "/api/v1/type/{id}"
				}
			]
		}
	]
}
  • Once the application is running, modify the file and change the "url_pattern" like this for the pokemon endpoint.
{
	"version": 2,
	"name": "Express API Gateway",
	"endpoints": [
		{
			"endpoint": "/pokemon",
			"method": "GET", 
			"backend": [
				{ 
					"host": ["https://pokeapi.co"],
					"method": "GET",
					"url_pattern": "/api/v1/pokemon"
				}
			]
		},
		{
			"endpoint": "/type/{id}",
			"method": "GET", 
			"backend": [
				{ 
					"host": ["https://pokeapi.co"],
					"method": "GET",
					"url_pattern": "/api/v1/type/{id}"
				}
			]
		}
	]
}

  • The endpoint change on hot while the application is running.
Similar Resources

Cloud-native and easy-to-use application management platform | 云原生且易用的应用管理平台

Cloud-native and easy-to-use application management platform | 云原生且易用的应用管理平台

Website • Documentation What is NEW! August 24, 2020 ,Rainbond 5.2 Stable version is officially released View Release Rainbond Introduction Cloud nati

Dec 29, 2022

Sample cloud-native application with 10 microservices showcasing Kubernetes, Istio, gRPC and OpenCensus.

Sample cloud-native application with 10 microservices showcasing Kubernetes, Istio, gRPC and OpenCensus.

Online Boutique is a cloud-native microservices demo application. Online Boutique consists of a 10-tier microservices application. The application is

Dec 31, 2022

Study Project for the application of micro services and requisition controls

Starting Endpoint GO with Retry Request Install GoLang for Linux Tutorial: LINK

Jul 4, 2022

This project extends the go-chi router to support OpenAPI 3, bringing to you a simple interface to build a router conforming your API contract.

Go OpenAPI This project extends the go-chi router to support OpenAPI 3, bringing to you a simple interface to build a router conforming your API contr

Mar 27, 2022

ftgogo - event-driven architecture demonstration application

ftgogo (food-to-gogo) is a Golang implementation of the FTGO application described in the book "Microservice Patterns" by Chris Richardson. A library edat was developed to provide for Golang many of the solutions that Eventuate, the framework used by FTGO, provides for Java.

Jan 3, 2023

Sample full stack micro services application built using the go-Micro framework.

Sample full stack micro services application built using the go-Micro framework.

goTemp goTemp is a full stack Golang microservices sample application built using go-micro. The application is built as a series of services that prov

Dec 26, 2022

Application tracing system for Go, based on Google's Dapper.

appdash (view on Sourcegraph) Appdash is an application tracing system for Go, based on Google's Dapper and Twitter's Zipkin. Appdash allows you to tr

Nov 28, 2022

goTempM is a full stack Golang microservices sample application built on top of the Micro platform.

goTempM is a full stack Golang microservices sample application built on top of the Micro platform.

goTempM is a full stack Golang microservices sample application built on top of the Micro platform.

Sep 24, 2022

Online Boutique: a cloud-native microservices demo application

This is an application forked from the GCP Microservice demo. Online Boutique is

Jan 5, 2022
This is a shopping basket workshop that shows how to use KrakenD API Gateway.
This is a shopping basket workshop that shows how to use KrakenD API Gateway.

Go Restful Microservices and KrakenD API Gateway Workshop This is a shopping basket workshop that shows how to use KrakenD API Gateway. Consist of 5 m

Jan 3, 2023
Conversion from OpenAPI definitions to krakend configuration.

Description Basic conversion from OpenAPI specification to Krakend config. This is extendable with custom OpenAPI attributes and more support for both

Dec 13, 2022
A library to help you create pipelines in Golang

pipeline Pipeline is a go library that helps you build pipelines without worrying about channel management and concurrency. It contains common fan-in

Dec 13, 2022
micro-draft-manager is a microservice that helps you to manage unstructured data in your application with sorting and full-text search

micro-draft-manager is a microservice that helps you to manage unstructured data in your application with sorting and full-text search. For example, y

Nov 24, 2021
This project implements p11-kit RPC server protocol, allowing Go programs to act as a PKCS #11 module without the need for cgo

PKCS #11 modules in Go without cgo This project implements p11-kit RPC server protocol, allowing Go programs to act as a PKCS #11 module without the n

Nov 30, 2022
Create production ready microservices mono repo pattern wired with Neo4j. Microservices for other languages and front end repos to be added as well in future.
Create production ready microservices mono repo pattern wired with Neo4j. Microservices for other languages and front end repos to be added as well in future.

Create Microservices MonoRepo in GO/Python Create a new production-ready project with backend (Golang), (Python) by running one CLI command. Focus on

Oct 26, 2022
Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows.
Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows.

argocon-21-demo Demo for my talk at ArgoCon '21 showing how to use Go to create and submit dynamic Argo Workflows. This repo implements a Go-based CLI

Oct 12, 2022
The service processes HTTP requests to create, get, update some data

portal This generated README.md file loosely follows a popular template. One paragraph of project description goes here. Getting Started These instruc

Dec 24, 2021
Just a quick demo of how you can use automatically generated protobuffer and gRPC code from buf.build

buf.build demo The purpose of this repository is to demonstrate how to use the services offered by buf.build for hosting protobuffer definitions and a

Jan 4, 2022
Cortex Gateway: a microservice which strives to help you administrating and operating your Cortex Cluster in multi tenant environments
Cortex Gateway: a microservice which strives to help you administrating and operating your Cortex Cluster in multi tenant environments

Cortex Gateway Cortex Gateway is a microservice which strives to help you administrating and operating your Cortex Cluster in multi tenant environment

Jan 14, 2022