Giter Club home page Giter Club logo

spring-cloud-microservice-example-1's Introduction

spring-cloud-microservice-example

Spring cloud microservice example using Netflix OSS. Currently uses eureka, ribbon, feign, and hystrix from the Netflix OSS stack.

Modules

eureka

Starts the eureka server for service discovery (http://localhost:8761/ user=user, password=password)

service mongodb

A microservice for storing small files (http://localhost:8081/remoteFiles/)

  • Registers remote file service with Eureka
  • Uses MongoDB for persistence of data and files

service aws

A microservice for storing small files (http://localhost:8081/remoteFiles/)

  • Registers remote file service with Eureka
  • Uses AWS services (DynamoDB and S3) for persistence of data and files
  • make sure to set environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_KEY

Manual setup

  • Setup DynamoDB table named remotefile
  • Setup S3 bucket named remotefilesvc

ui

A simple UI to upload and download files (http://localhost:9090/)

  • Uses Spring MVC and Thymeleaf template
  • Uses restTemplate and feign to lookup service from eureka via ribbon
  • Uses Hystrix to create a circuit breaker for get files, Default returns an empty list.

Prerequisite

  • Install and configure maven.
  • Install and start mongodb.

Run

Compile and run each module by executing the command "mvn spring-boot:run". To run on another port use "spring-boot:run -Dserver.port=[port]"

Docker instance.

Currently this is supported in the service module using the spotify docker plugin.

  • Run "mvn clean package docker:build" docker target is created.
  • In target/Docker directory zip the results of the modules and
  • Upload the docker zip by creating a docker beanstalk entry for each.

Environment Variables

  • Set eureka's url in the ui and service module with EUREKA_CLIENT_SERVICEURL_DEFAULTZONE environment property.
  • Set AWS_ACCESS_KEY_ID and AWS_SECRET_KEY in service-aws using environment variables.
  • For routing purposes you may also need to set EUREKA_INSTANCE_HOSTNAME and EUREKA_INSTANCE_NONSECUREPORT.

spring-cloud-microservice-example-1's People

Contributors

craigivy avatar

Watchers

James Cloos avatar damozhiying 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.