Giter Club home page Giter Club logo

microservice-skeleton's Introduction

Microservice skeleton

This demonstrates how to create a microservice with api, http-client and schema as separate jars.

  • microservice-api
  • microservice-http
  • microservice-schema

Read Building Microservice, Chapter 5/ "Sharing code via libraries".

Also read

publishing artifacts

λ gradle test

BUILD SUCCESSFUL in 0s
5 actionable tasks: 5 up-to-date

λ gradle publishToMavenLocal
λ ls -l ~/.m2/repository/org/duwamish/microservice/
total 0
drwxr-xr-x  4 prayagupd  184630988  128 Jul 21 16:11 microservice-api
drwxr-xr-x  4 prayagupd  184630988  128 Jul 21 16:13 microservice-schema

creating fat artifact

λ gradle fatJar
λ ls -l microservice-api/build/libs/
total 8
-rw-r--r--  1 prayagupd  184630988  1644 Jul 21 16:00 microservice-api-1.0.jar

λ ls -l microservice-schema/build/libs/
total 8
-rw-r--r--  1 prayagupd  184630988  1233 Jul 21 16:00 microservice-schema-1.0.jar

run microservice

λ gradle clean run

curl localhost:8080/v1/ads
[{"ads":["1","2"]}]


## logs
-------------------------------------- start selection request1 ------------------------
-------------------------------------- start selection request2 ------------------------
rank request1 started: pool-2-thread-1: 5005
rank request2 started: pool-2-thread-1: 5007

rank request1 completed: pool-2-thread-1: 8015
rank request2 completed: pool-2-thread-1: 8018

Response created in pool-2-thread-1: 8018
Response completed in pool-2-thread-1: 8018

Implementing Microservice Communication

  1. Looking for ideal technology: SOAP, REST, gRPC
  2. Make backward compatibility easy
  3. Make your interface explicit

Upstream/ consumer microservices practices

be conservative in what you do, be liberal in what you accept from others.
Jon Postel

Downstrea microservices

microservice-skeleton's People

Contributors

prayagupa avatar

Watchers

 avatar  avatar  avatar

microservice-skeleton's Issues

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.