Giter Site home page Giter Site logo

tutorial-microprofile's Introduction

MicroProfile Tutorial

This tutorial demonstrates the use of MicroProfile technologies for implementing a set of cloud-native microservices. The tutorial is made up of a number of Open Liberty Guides each of which demonstrates different MicroProfile technologies. Each guide is designed to be taken independently so if you just want to learn about a specific technology you can just take that guide. If, however, you're goal is to learn about all the MicroProfile capabilities, then working through them in the order shown below is recommended.

Tutorial Preparation

To save time during the tutorial, it's best to set up your machine beforehand. The instructions below show the pre-requisites to install and how to avoid lengthy downloads.

Prerequisites

To use these guides you need the following prerequisites:

  1. Download and unzip Java 8 JDK (e.g. https://developer.ibm.com/languages/java/semeru-runtimes/downloads)
    • Set JAVA_HOME to the Java 8 JDK
    • Note: If using Java 11 and unix system, you may need to set "ulimit -n 1024"
  2. Download and unzip Apache Maven (https://maven.apache.org/download.cgi)
    • Add /<apache-maven-3.9.0>/bin to PATH environment variable
    • Note: 3.6.0+ is required for Liberty Maven Plugin
  3. Install Git client (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
  4. An editor with Java support (e.g. Eclipse, VS Code, IntelliJ)
  5. Make sure your command prompt can run git --version and mvn -version
  6. Docker (Optional - not required for the guides in this tutorial but used in other guides you may wish to try afterwards)

Downloads

If you will be taking the tutorial at a location with limited network bandwidth, it is recommended you do the following beforehand in order to populate your local .m2 repo and Docker cache (as before, the Docker step is optional).

git clone https://github.com/OpenLiberty/tutorial-microprofile.git
cd tutorial-microprofile
mvn install
docker build -t prime:mym2 .

Introduction

Cloud-native is an approach to application development and deployment. It's the product of a number of industry movements over the past 10-15 years - agile development practices, DevOps, Microservices and Cloud. Cloud-native applications are developed using agile practices, use continuous integration/continuous delivery to streamline deployment, are architected around team-aligned microservices, and leverage the cloud for rapid deployment at scale.

When choosing which technologies to use for cloud-native Microservices, the combination of open source and open standards can be very important. The combination enables a low cost (free) of entry and at the same time avoids being locked in to a single vendor implementation.

Eclipse MicroProfile is a set of industry specifications for developing and deploying cloud-native Java Microservices. The specifications address the important challenges of cloud-native microservices, such as toleration of service failures, security, service metrics and health, and more. Open Liberty is an open source, lightweight, composable Java server that implements the MicroProfile specifications.

This tutorial demonstrates how to address cloud-native microservice requirements using MicroProfile technology provided by Open Liberty. The tutorial guices can be taken independently, or in the order they are introduced, below.

If you have feedback on a specific guide, we'd appreciated a github issue or pull request against that guide, and similarly if you have feedback on this tutorial document, please raise an issue or submit a pull request.

Creating a RESTful web service

Learn how to create a REST service with JAX-RS, JSON-P, and Open Liberty that will expose the JVM’s system properties.

The Guide: https://openliberty.io/guides/rest-intro.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-rest-intro

Injecting dependencies into microservices

Learn how to use Contexts and Dependency Injection to manage and inject dependencies into RESTful web services.

The Guide: https://openliberty.io/guides/cdi-intro.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-cdi-intro

Consuming RESTful services with template interfaces

Learn how to use MicroProfile Rest Client to invoke RESTful microservices over HTTP in a type-safe way.

The Guide: https://openliberty.io/guides/microprofile-rest-client.html

If you have feedback or find problems, please raise an issue here: https://github.com/openliberty/guide-microprofile-rest-client

Configuring Microservices

Learn how to inject external static and dynamic configuration to microservices using MicroProfile Config.

The Guide: https://openliberty.io/guides/microprofile-config.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-config

Building fault-tolerant microservices with the @Fallback annotation

Learn how to use the MicroProfile Fault Tolerance specification to enable applications to function even when one of the microservices is unavailable.

The Guide: https://openliberty.io/guides/microprofile-fallback.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-fallback

Securing microservices with JSON Web Tokens

You’ll explore how to control user and role access to microservices with MicroProfile JSON Web Token (MicroProfile JWT).

The Guide: https://openliberty.io/guides/microprofile-jwt.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-jwt

Documenting RESTful APIs

Explore how to document and filter RESTful APIs from code or static files by using MicroProfile OpenAPI.

The Guide: https://openliberty.io/guides/microprofile-openapi.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-openapi

Providing metrics from a microservice

Learn how to provide system and application metrics from a microservice using MicroProfile Metrics.

The Guide: https://openliberty.io/guides/microprofile-metrics.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-metrics

Adding health reports to microservices

Learn how to provide and check the health of a microservice using MicroProfile Health.

The Guide: https://openliberty.io/guides/microprofile-health.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-health

Enabling distributed tracing in microservices

Explore how to enable and customize tracing of JAX-RS and non-JAX-RS methods by using MicroProfile OpenTracing.

The Guide: https://openliberty.io/guides/microprofile-opentracing-jaeger.html

If you have feedback or find problems, please raise an issue here: https://github.com/OpenLiberty/guide-microprofile-opentracing-jaeger/

Containerize microservices

Explore how to containerize microservices using Docker. The Guide: https://openliberty.io/guides/containerize.html

Deploy microservices to Kubernetes

Explore how to deploy microservices to Kubernetes and mange them with Kubernetes CLI. The Guide: https://openliberty.io/guides/kubernetes-intro.html

Explore how to externize configuration and use Kubernetes ConfigMaps and Secrets to configure your microservices. The Guide: https://openliberty.io/guides/kubernetes-microprofile-config.html

Learn how to check the health of microservices on Kubernetes by setting up readiness and liveness probes to inspect MicroProfile Health Check endpoints. The Guide: https://openliberty.io/guides/kubernetes-microprofile-health.html

Manage your services using Istio

Explore how to manage microservice traffic using Istio. The Guide: https://openliberty.io/guides/istio-intro.html

Explore how to manage the impact of failures by using MicroProfile and Istio Fault Tolerance to add retry and fallback behaviours to microservices. The Guide: https://openliberty.io/guides/microprofile-istio-retry-fallback.html

Cloud deployment

Explore how to use Minishift to deploy microservices to an Origin Community Distribution of Kubernetes (OKD) cluster. The Guide: https://openliberty.io/guides/okd.html

Explore how to deploy microservices to Red Hat OpenShift. The Guide: https://openliberty.io/guides/cloud-openshift-operator.html

tutorial-microprofile's People

Contributors

gcharters avatar gkwan-ibm avatar emily-jiang avatar azquelt avatar gkertaseferi avatar gracejansen avatar xstefank avatar kgibm avatar

Watchers

James Cloos avatar

Forkers

erdemdmr

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.