Giter Site home page Giter Site logo

cab-service-b's Introduction

MicroProfile generated Application

Introduction

MicroProfile Starter has generated this MicroProfile application for you containing some endpoints which are called from the main application (see the service-a directory)

The generation of the executable jar file can be performed by issuing the following command

mvn clean compile quarkus:build

This will create a jar file quarkus-runner.jar within the target maven folder. This can be started by executing the following command

java -Dquarkus.http.port=8180 -jar target/quarkus-runner.jar

You can also start the project in development mode where it automatically updates code on the fly as you save your files:

mvn -Dquarkus.http.port=8180 clean compile quarkus:dev

Last but not least, you can build the whole application into a one statically linked executable that does not require JVM:

mvn clean compile quarkus:native-image -Pnative

Native executable build might take a minute. Then you can execute it on a compatible architecture without JVM:

./target/quarkus-runner -Dquarkus.http.port=8180

Note on Native image

  • You need GraalVM installed from the GraalVM web site. Using the community edition is enough. Version 19.1.1+ is required.
  • The GRAALVM_HOME environment variable configured appropriately
  • The native-image tool must be installed; this can be done by running gu install native-image from your GraalVM directory

Specification examples

JWT Auth

Have a look at the TestSecureController class (main application) which calls the protected endpoint on the secondary application. The ProtectedController contains the protected endpoint since it contains the @RolesAllowed annotation on the JAX-RS endpoint method.

The TestSecureController code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs.

Rest Client

A type safe invocation of HTTP rest endpoints. Specification here

The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean.

cab-service-b's People

Contributors

emily-jiang avatar

Watchers

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