Giter Site home page Giter Site logo

corant's Introduction

Corant

License Codacy Badge Join the chat at https://gitter.im/corant-project/community

Microservice stack with CDI MicroProfile.

Corant is a microservice development stack. Use Maven for builds, base on JDK 11 or above (JDK 8 will no longer be supported, only supported for versions before 1.3), use CDI as container. The following projects are under the corant project.

Corant projects

1. corant-boms

Maven dependence descriptions that are used in corant.

2. corant-parent

Maven build descriptions

3. corant-devops

Corant build and testing project. include maven build plugins and framework testing.

4. corant-shared

The global shared project, contains utility classes for resource handling, 
string handling, reflection, object conversion, assertion, etc. Most projects rely on this.    

5. corant-config

The application configuration processing that implemented the microprofile-config specification.

6. corant-kernel

Initialize the application and the container, provide related operations such as boot/startup/shutdown, 
and related pre-processing and post-processing.

7. corant-context

Container, context and concurrent processing module, providing some convenient context processing classes 
and managed executor service. This module will be fully compatible with microprofile-context-propagation 
in the future.

8. corant-modules

Extension project. This project includes many subprojects, integrate JEE or other open source
 components to make integration and development easier.
Currently we have supported specifications JTA/JPA/JMS/JNDI/JAXRS/SERVLET/JCACHE/MICROPROFILES ,etc.,
supported components or frameworks include ElasticSearch/Mongodb/Redis/Undertow, etc.,
and also provide some common development practices such as DDD, Dynamic SQL/NoSQL query framework, etc.

Getting started

Learn how to create a Hello World app quickly and efficiently.

1. Prerequisites

  • maven 2.2.1 (or newer)
  • JDK 8 or 11+

2. Create the project

  • Define the version of corant in pom.xml.Use the latest version(required jdk 11+).Jdk 8 for the version: 1.3
<properties>
     <version.corant>XXXX-SNAPSHOT</version.corant>
</properties>
  • Now add corant-kernel dependency. Initialize the application and container.
 <dependency>
    <groupId>org.corant</groupId>
    <artifactId>corant-kernel</artifactId>
    <version>${version.corant}</version>
 </dependency>
  • Add HTTP server. We prefer to use Undertow.
<dependency>
    <groupId>org.corant</groupId>
    <artifactId>corant-modules-webserver-undertow</artifactId>
    <version>${version.corant}</version>
</dependency>

This is the bare minimum required to run an app.We don't need to include a web.xml file as like application servers Corant supports annotation scanning.

@ApplicationScoped
public class App  {
  public static void main(String[] args) {
    Corant.startup(args);
  }
}

3. Add JAX-RS component

  • Add dependency.
<dependency>
    <groupId>org.corant</groupId>
    <artifactId>corant-modules-jaxrs-resteasy</artifactId>
    <version>${version.corant}</version>
</dependency>
  • Extends the javax.ws.rs.core.Application.
@ApplicationScoped
@ApplicationPath("/")
public class App extends Application {
  public static void main(String[] args) {
    Corant.startup(args);
  }
}
  • Add a REST endpoint.
@Path("/app")
@ApplicationScoped
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class HelloWorldEndpoint {
  @Path("/greeting")
  @GET
  public Response hello() {
    return Response.ok("Hello World!").build();
  }
}
Hello World!

Congratulations you have created a simple and lightweight Java EE app.

For some demo projects, please check

corant's People

Contributors

codacy-badger avatar dependabot[bot] avatar don43 avatar finesoft avatar gitter-badger avatar hunshikan avatar sushuaihao avatar

Watchers

 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.