Coder Social home page Coder Social logo

krakend-eureka's Introduction

Krakend Eureka

An Eureka client and subscriber for the KrakenD framework.

Build the example

Go 1.8 is a requirement

$ make

Using Eureka client

	eurekaClient, err := eureka.New(ctx, serviceConfig.ExtraConfig)
	if err != nil {
		log.Fatal("ERROR:", err.Error())
	}

	routerFactory := krakendgin.NewFactory(krakendgin.Config{
		Engine:         gin.Default(),
		Middlewares:    []gin.HandlerFunc{},
		Logger:         logger,
		HandlerFactory: krakendgin.EndpointHandler,
		ProxyFactory: customProxyFactory{
			logger,
			proxy.DefaultFactoryWithSubscriber(logger, eureka.SubscriberFactory(ctx, eurekaClient)),
		},
	})

Registering your application in Eureka

eurekaClient.Register("krakend-gw", GetLocalIP(), serviceConfig.Port)

Run

Running it as a common executable, logs are send to the stdOut and some options are available at the CLI

$ ./krakend_eureka_example
Usage of ./krakend_eureka_example:
  -c string
        Path to the configuration filename (default "/etc/krakend/configuration.json")
  -d	Enable the debug
  -l string
        Logging level (default "ERROR")
  -p int
        Port of the service

krakend-eureka's People

Contributors

joaoqalves avatar kpacha avatar

Stargazers

 avatar  avatar  avatar A. Lombarte avatar

Watchers

 avatar  avatar  avatar

Forkers

kpacha bisegni

krakend-eureka's Issues

Update of Eureka Instances doesn't work

Hi,

I've applied the plugin to the source code of KrakenD as it's explained in the example and
the registration to Eureka Server happens without no issue but the update of the eureka instances doesn't.

image

When I open the code of subscriber.go inside an editor, it says that the goroutine inside the loop() function is unreachable,
in fact nothing is printed in the console(there is a fmt.Println("LOOP") inside the goroutine in question), so i can easy understand that the gorutine is never executed and the instances of eureka are never updated.

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.