Code Monkey home page Code Monkey logo

spring-cloud-samples's Introduction

spring-cloud-samples

Simple implementations of some of Spring Cloud services

  • Each service calls config-service to get their configuration files.
  • Each service register itself with Netflix Eureka.
  • The gateway-service adds proxy and load balancing to greeting services registered with Eureka.
  • The admin-server brings up an easy way to consult actuator services.

Installation

This project has no extra external dependencies, you just need to import as a maven project and then run in the root project:

mvn clean install

Starting

To start the project, you have two options:

Manually

The boot order is:

  1. config-service
  2. eureka-service
  3. greeting-instance
  4. gateway-service
  5. admin-service

First, initialize the Swarm mode:

docker swarm init

Then create the overlay network:

docker network create -d overlay spring-cloud-network

In the first run and after a project re-build, use:

docker-compose up --build --force-recreate --scale greeting-instance=3

After that, you can just use:

docker-compose up --scale greeting-instance=3

The --scale greeting-instance=3 option will start tree instances of that service, you can choose the number you want.

Services and panels

Greeting service can be called through gateway-service at localport 8080

curl http://localhost:8080/greeting

Greeting service has a basic auth system:

user password
admin secret

To see the currently registered services you can navigate in your preferred browser to the address:

http://localhost:8761

Eureka portal has a basic auth system:

user password
eureka_admin secret

The admin portal will show you all the info from the exposed actuator services. In this sample they all are exposed with no security. (Never replicate this in a production scenario).

Admin portal has a basic auth system:

user password
admin secret

In your preferred browser, navigate to:

http://localhost:8500

All the services here are simple examples of its on projects, configured to work together. More services, tests, and examples will come.

spring-cloud-samples's People

Contributors

mateus-batista avatar mattbatista1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.