GithubHelp home page GithubHelp logo

eriklupander / go-microservice-eureka Goto Github PK

View Code? Open in Web Editor NEW
51.0 6.0 15.0 9 KB

Sample golang project with a simple http service exposing itself by registering with Eureka.

License: MIT License

Shell 1.73% Go 98.27%

go-microservice-eureka's Introduction

A sample go microservice with Eureka integration

This very simplistic little http service provides hard-coded 'vendors' on /vendors/{id} and is used as an example project for a blog post on http://callistaenterprise.se/blogg/teknik/

Building

Go SDK 1.5+ installed.

Clone this repo, set your GOPATH / GOROOT to the folder you cloned into.

cd src/github.com/eriklupander/go-eureka/*.go
go get

The docker image can be built using the .sh script:

#!/usr/bin/env bash

export GOARCH=amd64
export GOOS=linux
go build -o bin/goeureka src/github.com/eriklupander/goeureka/*.go
docker build -t vendor .
export GOARCH=amd64
export GOOS=darwin

Update for your target OS accordingly.

Running

This microservice can be ran standalone, though it will keep trying to contact the Eureka server at http://192.168.99.100:8761 until exit or success. I.e - this code is meant to be executed in the context of the blog post.

Anyway - you can hopefully start it using go run:

 > go run src/github.com/eriklupander/go-eureka/*.go

Have fun!

This software uses the MIT license, see LICENSE.md

Uses gorilla/context and gorilla/mux Copyright (c) 2012 Rodrigo Moraes Uses twinj/uuid Copyright (C) 2011 by Krzysztof Kowalik [email protected], Copyright (C) 2014 by Daniel Kemp [email protected] Derivative work

go-microservice-eureka's People

Contributors

eriklupander avatar

Stargazers

RAIMUNDOS54 avatar  avatar Vladyslav avatar Tabu Thevarajan avatar  avatar  avatar SouthWolf avatar Ramil Mirhasanov avatar Vincent Simpson avatar Omar Magoury avatar  avatar Gyan chand Mohanty avatar Jacob ZHONG avatar 汪功博 avatar Sergey Vikulov avatar Ghost From Heaven avatar  avatar Kai Wells avatar Qiao Zhang avatar liujunfei avatar fightingbamboo avatar raysonxin avatar Margus H. avatar Ben avatar Hua avatar ccm avatar  avatar TOBLERONE。 avatar Dima avatar Kevin Zhang avatar iceman avatar Ahmad Faiyaz avatar Wei Yichen avatar dsheng avatar cruboy avatar Joshua Braun avatar FrankBian avatar Julian avatar Ferdinand Mütsch avatar hoopa avatar  avatar Tony Wang avatar Anton Rymkus avatar John Deng avatar Michael.谢 avatar Applee avatar 钟健鑫(Jason) avatar Ricardo Cunha avatar  avatar Mini Shridhar avatar  avatar

Watchers

James Cloos avatar  avatar Margus H. avatar Yining Chen avatar YongYang avatar  avatar

go-microservice-eureka's Issues

It cant register itself to eureka

Hi Man

I encounter a issue when using your repo to register to Eureka. in Eureka side we could saw as below:

discovery | 2016-11-07 08:52:05.249 WARN 1 --- [nio-8761-exec-4] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: lease doesn't exist, registering resource: VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765
discovery | 2016-11-07 08:52:05.249 WARN 1 --- [nio-8761-exec-4] c.n.eureka.resources.InstanceResource : Not Found (Renew): VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765
discovery | 2016-11-07 08:52:35.256 WARN 1 --- [io-8761-exec-10] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: lease doesn't exist, registering resource: VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765
discovery | 2016-11-07 08:52:35.256 WARN 1 --- [io-8761-exec-10] c.n.eureka.resources.InstanceResource : Not Found (Renew): VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765
discovery | 2016-11-07 08:53:05.263 WARN 1 --- [nio-8761-exec-4] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: lease doesn't exist, registering resource: VENDOR - 172.17.0.6:vendor:426d900b-2063-471c-9634-82f2b8fa2765

Can you help? thanks a lot!

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.