Skip to content

guodawei223/vertx-zero

 
 

Repository files navigation

Vertx Zero Up Framework

Maven Central Apache License 2 Build Status Gitter Maintainability
Waffle.io - Columns and their card count

This project is based on Vert.x, the idea came from Spring-Boot framework. It could help developers focus on business requirements instead of more details of Vert.x. The project contains two parts "Up" and "Zero". "Up" means running up, "Zero" means no configuration provided, you could run your project with default configuration only.

Micro Service architecture is a future focused method to design and build mature system and help more companies to implement project faster, based on this idea, Vertx Zero Up Framework came out. It's micro-service oriented framework and will be verified by real projects. Also it provide a tool set to help developers to do correct things. The last point is that because of Event Driven Model, it's high performance framework.

This framework contains four sub-projects, all these projects are put in vertx-gaia project

  • vertx-gaia/vertx-co: Core Library of Zero Up Framework
  • vertx-gaia/vertx-tp: Third part integration components in Zero Up Framework
  • vertx-gaia/vertx-ifx:Chinese Service Plugins for different chinese local cloud services(中国本土插件包)
  • vertx-gaia/vertx-up: Zero Up Engine with nested vert.x web container
  • vertx-gaia/vertx-rx: Zero Up Engine with nested rxjava web container instead of web container
  • vertx-import: Zero Usage dependency project to perform development, provide uniform dependency for your projects.
  • vertx-zeus/*: Zero Examples, it contains all the tutorials of this framework

If your wan't to study vert.x development skill, you can refer chinese tutorial:《Vert.x逐陆记》.

1. Envrionment

If you want to use Zero framework, you can add following dependency into you pom.xml to use Zero:

    <parent>
        <artifactId>vertx-import</artifactId>
        <groupId>cn.vertxup</groupId>
        <version>0.4.8</version>
    </parent>

2. Boot Up

In your project, you can provide main entry only as following to run Zero ( Annotated with @Up ) .

import io.vertx.up.VertxApplication;
import io.vertx.up.annotations.Up;

@Up
public class Driver {

    public static void main(final String[] args) {
        VertxApplication.run(Driver.class);
    }
}

Once the Zero is up, you can see following logs in your console ( The default port is 6083 ):

[ ZERO ] ZeroHttpAgent Http Server has been started successfully. \
    Endpoint: http://0.0.0.0:6083/

3. Documentation

For all tutorial testing cases, you can import following resource with Postman Tool

(Postman link is rebuilding )

  1. Restful Web Service
    1. D10001 - Getting Start
    2. D10002 - Origin Story, Hi Zero
    3. D10003 - JSR311, @Path...EndPoint
    4. D10004 - JSR311, @GET,@POST...Http Method
    5. D10005 - JSR311, @QueryParam...Parameters
    6. D10006 - JSR311, @PathParam...Parameters
    7. D10007 - JSR311, @FormParam...Parameters
    8. D10008 - JSR311, @HeaderParam...Parameters
    9. D10009 - JSR311, @CookieParam...Parameters
    10. D10010 - Zero JSR311, @BodyParam...Parameters
    11. D10011 - Zero JSR311, @BodyParam...Pojo
    12. D10012 - Zero JSR311, @StreamParam...Parameters
    13. D10013 - Zero JSR311, @StreamParam...File/FileUpload
    14. D10014 - Zero JSR311, @SessionParam...Parameters
    15. D10015 - By Typed Parameters
    16. D10016 - JSR311, @Consumes...Media Type
    17. D10017 - JSR311, @Produces...Media Type
  2. Async Non-Blocked
    1. D10018 - Non-Blocking, Enable EventBus
    2. D10019 - Non-Blocking, Mode 1 Sync Mode
    3. D10020 - Non-Blocking, Mode 2 Ping Mode
    4. D10021 - Non-Blocking, Mode 3 One Way Mode
    5. D10022 - Non-Blocking, Mode 4 Async Mode ( Java Style )
    6. D10023 - Non-Blocking, Mode 4 Experimental extension
    7. D10024 - Non-Blocking, Mode 5 Async Mode ( vert.x style )
    8. D10025 - ( Recommend ) Non-Blocking, Mode 5 Experimental extension
  3. JSR330 Dependenncy Injection
    1. D10026 - JSR330, @Inject Simple Java Object
    2. D10027 - JSR330, @Inject One Implementation
    3. D10028 - Zero JSR330, @Inject Multi Implementation
  4. JSR303 Bean Validation
    1. D10029 - JSR303, @NotNull
    2. D10030 - JSR303, @NotNull message
    3. D10031 - JSR303, @NotNull message template
    4. D10032 - JSR303, @DefaultValue for parameters
    5. D10033 - JSR303, @Null for value
    6. D10034 - JSR303, @AssertTrue/@AssertFalse for boolean
    7. D10035 - JSR303, @Min/@Max for numeric
    8. D10036 - JSR303, @DecimalMin/@DecimalMax for decimal
    9. D10037 - JSR303, @Size usage
    10. D10038 - JSR303, @Digits for decimal
    11. D10039 - JSR303, @Future, @Past for date
    12. D10040 - JSR303, @Pattern for regular expression
    13. D10041 - JSR303, 2.x version
    14. D10042 - JSR303, Pojo First
    15. D10043 - Zero JSR303, Body Validation
  5. JSR340 Filter/Listener
    1. D10098 - JSR340 Filter in Agent
    2. D10099 - JSR340 Filter in Worker
    3. D10100 - JSR340 Multi Filters
  6. Programming Style & User-defined
    1. D10044 - Programming Styles
    2. D10045 - Interface Style
    3. D10094 - Exception, Defined your Errors
    4. D10096 - Exception, Readable message to help UI
  7. Utility X Tool Box
    1. D10046 - Utility X Turn-On
    2. D10047 - Utility X, JsonObject Processing
    3. D10048 - Utility X, Pager Processing
    4. D10049 - Utility X, Sorter Processing
    5. D10050 - Utility X, Errors
    6. D10051 - Utility X, JsonArray/Unique Extract
    7. D10052 - Utility X, User Data
    8. D10053 - Utility X, Normalized Response
    9. D10054 - Utility X Input, Agent Mode
    10. D10055 - Utility X Input, Interface Style
    11. D10056 - Utility X Basic Future
    12. D10057 - Utility X, thenParallel
    13. D10058 - Utility X, thenParallelArray/Json
    14. D10059 - Utility X, thenScatterJson
    15. D10060 - Utility X, thenError
  8. Jooq for MySql
    1. D10061 - Jooq/mysql, Configuration
    2. D10062 - Jooq/CRUD, Read Operation
    3. D10063 - Jooq/CRUD, Write Operation
    4. D10064 - Jooq/CRUD, Fetch One Operation
    5. D10065 - Jooq/CRUD, Fetch List Operation
    6. D10066 - Jooq/CRUD, Filter Syntax
    7. D10067 - Jooq/CRUD, Paging/Sorting
    8. D10097 - Jooq/CRUD, Save/Existing Operation
  9. Mongo
    1. D10107 - Mongo, Configuration
  10. Yaml Connfiguration
    1. D10068 - Configuration, vertx.yml
    2. D10069 - Configuration, vertx-server.yml
    3. D10070 - Configuration, vertx-inject.yml
    4. D10071 - Configuration, vertx-error.yml
    5. D10072 - Configuration, vertx-mysql.yml
    6. D10073 - Configuration, vertx-mongo.yml
    7. D10074 - Configuration, vertx-etcd3.yml
    8. D10075 - Configuration, vertx-rpc.yml
    9. D10102 - Configuration, vertx-redis.yml
    10. D10103 - Configuration, vertx-secure.yml
    11. D10106 - Configuration, vertx-tp.yml
  11. Native Support
    1. D10076 - Vert.x Native, MySqlClient
    2. D10078 - Vert.x Native, MongoClient
    3. D10101 - Vert.x Native, RedisClient
    4. D10105 - Vert.x Native, SharedData
  12. Micro Service Development
    1. D10082 - Micro, Environment Preparing
    2. D10083 - Micro, Rpc Mode
    3. D10084 - Micro, Configuration
    4. D10085 - Micro, Simple Rpc
    5. D10086 - Micro, Future with Utility X
    6. D10087 - Micro, Multi Rpc Calls
    7. D10088 - Micro Stream, Sender ( Agent ) to Terminator
    8. D10089 - Micro Stream, Consumer ( Worker ) to Terminator
    9. D10090 - Micro Stream, Consumer Sync Mode to Terminator
    10. D10091 - Micro Stream, Consumer Async Mode to Terminator
    11. D10092 - Micro Stream, Consumer T Mode to Terminator
    12. D10093 - Micro Stream, Originator/Coordinator/Terminator
  13. Security Module
    1. D10095 - Security, Basic Authorization
    2. D10104 - Security, Jwt Authorization
  14. Chinese Plugins
  15. Third Part Reference
    1. D10077 - Reference, Mongo Setup
    2. D10079 - Reference, Mini k8s
    3. D10080 - Reference, Istio
    4. D10081 - Reference, Istio Addon

4. Case in Action

5. Logging in Zero

You also could use following function in your coding to get Logger component.

// Zero Logger initialized, connect to vert.x logging system directly but uniform managed by zero.
import io.vertx.up.log.Annal;

// Then in your class
public final class Statute {

    private static final Annal LOGGER = Annal.get(Statute.class);
    ......
}

Packages

No packages published

Languages

  • Java 96.9%
  • PLpgSQL 2.4%
  • Other 0.7%