GithubHelp home page GithubHelp logo

amilktea / spring-cloud-sidecar-polygot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from baratharivazhagan/spring-cloud-sidecar-polygot

0.0 1.0 1.0 177 KB

This project contains samples demonstrating the usage of side car polygot

Dockerfile 18.29% Java 75.72% JavaScript 5.99%

spring-cloud-sidecar-polygot's Introduction

spring-cloud-sidecar-polygot-demo

This project contains demonstrates the usage of netflix`s side car polygot. Spring cloud side car helps to register non jvm applications in eureka service registration server and available as part of service discovery.

Note: Branches 1.x.x/2.x.x versions makes it compatible with spring boot versions 1.x.x/2.x.x. Kindly choose branch w.r.t spring boot release versions.

side car

Compatability Matrix

choose the branch based on below versions.

Branch/Version Spring Boot Spring Cloud Node Js
master 2.1.5.RELEASE Greenwich.SR1 12.4.0
2.1.4 2.1.4.RELEASE Greenwich.RELEASE 12.4.0
2.1.2 2.1.2.RELEASE Greenwich.RC2 10.16.0
2.0.3 2.0.3.RELEASE Finchley.RELEASE 8.16.0
1.5.6 1.5.6.RELEASE Dalston.SR3 8.16.0

Projects

Name Port Description
eureka-server 9000 Eureka server - service registration server
csstore-microservice 9001 Service discovery microservice registered with eureka server
msstore-microservice 9002 Service discovery microservice registered with eureka server
sidecar 9004 Side car proxy for routing and filtering to wstore node app
wstore-node-express 3000 Node express (non jvm ) application
zuul-proxy 9005 Zuul proxy for routing and filtering

How to build and run ?

  • Download/Clone the repository :
$ git clone https://github.com/BarathArivazhagan/spring-cloud-sidecar-polygot.git
$ cd spring-cloud-sidecar-polygot
  • Maven build :
 $ ./mvnw clean install
  • Docker image build :

    # Note change the docker images as per your image name in docker compose file
    $ docker-compose build 
  • To run the application :

$ docker-compose up

How to test the application ?

Use zuul proxy to route to respective microservices.

zuul route definition :

zuul:
  routes:
    msstore :       
        path: /msstore/**
        url: http://localhost:9002
    csstore: 
        path: /csstore/**
        url: http://localhost:9001

Service Urls:

http://localhost:9005/msstoremsstore
http://localhost:9005/csstorecsstore
http://localhost:9005/csstorewstore

Side car route definition

zuul:
  routes:
    wstore: 
      path: /wstore/**
      url: http://localhost:3000

sidecar:
  port: 3000
  health-uri: http://localhost:3000/health

Notes :

sidecar.port : Port must be same as the non jvm port
sidecar.health-uri: non jvm application should expose this url with json message {"STATUS" : "UP"} to indicate sidecar the app is UP.

How to test sidecar ?

Navigate to http://localhost:9004/wstore/home --> sidecar routes to non jvm(nodejs app)

Why Zuul as well as side car ?

yes, thats right. @EnableSideCar includes @EnableZuulProxy,so side car can act as zuul proxy itself. In order to provide separate proxy for side car(non jvm) based applications, this repo contains two proxies

zuul-proxy : provides proxy to jvm based applications.
sidecar : provides proxy to non jvm based applications.

How to rebuild the project after the changes?

$ docker-compose build

References

spring-cloud-sidecar-polygot's People

Contributors

baratharivazhagan avatar

Watchers

 avatar

Forkers

arul-cfkube

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.