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

Overview

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.
You might also like...
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

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

Study Project for the application of micro services and requisition controls

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

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

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.

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

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

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.

Online Boutique: a cloud-native microservices demo application

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

Owner
Arturo Elias
Arturo Elias
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

Suat KÖSE 62 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

Hamza Oral 13 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

Delivery Hero SE 142 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

Hamed Abdollahpour 1 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

Google 44 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 Microservices MonoRepo in GO/Python Create a new production-ready project with backend (Golang), (Python) by running one CLI command. Focus on

GoChronicles 14 Oct 26, 2022
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

null 5 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

Hamlet Avetikyan 0 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

Bjørn Borud 0 Jan 4, 2022
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

Delivery Hero SE 0 Jan 14, 2022